IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 Sequence objects.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Wed Jul 01, 2009 3:05 pm
Reply with quote

I have a requirement for generating unique numbers and I am using DB2 sequence object.

My sequence object is defined like this:
Code:

CREATE SEQUENCE MYSEQUENCE
    AS DECIMAL(18)                                 
      START WITH 1                                 
      INCREMENT BY 1                               
      MINVALUE 1                                   
      MAXVALUE 999999999999999999                 
      NO CYCLE                                     
      NO CACHE                                     
      ORDER                                       


Now my question is what happens when two different processes
request for this sequence number?
Is there a possiblility that DB2 will generate the same number?
In that case there can be an error of duplicate rows as this sequence number will be used to insert in a table as the key.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 01, 2009 3:17 pm
Reply with quote

Discussion in manual about Seqences
Back to top
View user's profile Send private message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Wed Jul 01, 2009 3:41 pm
Reply with quote

thanks. I will go thru it
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts Find missing sequence for every key DFSORT/ICETOOL 3
No new posts GDG all in sequence order JCL & VSAM 9
No new posts Sequence number generation for multip... DFSORT/ICETOOL 2
Search our Forums:

Back to Top