Results 1 to 3 of 3

Thread: trriger in DB2

  1. #1
    Join Date
    Aug 2005
    Posts
    3

    Unanswered: 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.

  2. #2
    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?

  3. #3
    Join Date
    Oct 2005
    Posts
    8
    sorry i don't know the answer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •