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