If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Seqnum generation!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-18-06, 21:30
kingp kingp is offline
Registered User
 
Join Date: Dec 2006
Posts: 10
Seqnum generation!!

Hi frends
All of u have been really helpful in suggestions..here wud like to ask for one more help

In DB2 STORE PROCEDURES im trying value of sequencely generated number to a variable seqnum which i have to use in the naming convention.
I am trying it this way

CREATE SEQUENCE sample_SEQ
| START WITH 0
| INCREMENT BY 1
| NO MAXVALUE
| NO CYCLE
| CACHE 20;
|
select (NEXT VALUE FOR SAMPLE_SEQ) into seqnum from sample_seq;
|

CAN SOMEONE KINDLY SUGGEST IF I M DOINT IT IN THE RITE WAY OR IS THR NEOTHER WAY TO DO IT... im writing the output of this SQL SP to txt files which would be recognized by their unique seq no...

Thanks in advance..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On