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 > trriger in DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-05, 10:05
rkoppala rkoppala is offline
Registered User
 
Join Date: Aug 2005
Posts: 3
trriger in DB2

hi,

my table has 2 columns col1,col2. col1 is primary key
i want to create a trigger that when i insert one parameter of col2,the col1 should be auto generated to the maximum , not by using identity or using sequence.
i should insert the second column only, when i insert, the primary key column also updated by its own by trigger in db2.
Reply With Quote
  #2 (permalink)  
Old 10-03-05, 10:22
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
When you say "generated to the maximum". Do you mean that you want to get the maximum existing value for the primary key and increment it for the new row? If so, how do you plan on handling multiple users inserting simultaneously? Is there a reason you don't want to use an identity column or sequence?
Reply With Quote
  #3 (permalink)  
Old 10-03-05, 19:14
fsledge fsledge is offline
Registered User
 
Join Date: Oct 2005
Posts: 8
sorry i don't know the answer
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