?example after insert trigger doing update on inserted row?

?example after insert trigger doing update on inserted row?

Post by Bill Smit » Wed, 06 Oct 2004 11:53:12


I am looking for an example 'after insert' trigger that performs an update
to a column in the master table. For example, I have an 'orders' table that
contains a 'PartNum' column. I would like to translate the part number
coming in on the inserted record to a new part number by doing a lookup in a
second table 'PartNumConversion' table that contains 2 columns 'oldPartNum',
'newPartNum'. I would also like to log the oldPartNum and NewPartNum to a
history/change table for logging purposes. Any example doing something
similiar would help. Environment DB2UDB 8.1,WinXP
Thanks, Bill