Could anyone please tell me how to do an inner join from the table that is the subject of a trigger.
The Sybase equivalent is:
CREATE TRIGGER upd_table on TRIGGERTABLE
FOR UPDATE AS BEGIN
set column1 = new.column1
, column2 = leftjointable.column2
where inserted new
, LEFTJOINTABLE leftjointable
, UPDATEDTABLE updatedtable
where new.id = updatedtable.id
and new.id *= leftjointable.id
However, since there is no concept of inserted in DB2, the trigger has only a "left outer join LEFTJOINTABLE" with no from clause and does not compile.
So how would the above statement translate into an AFTER UPDATE trigger in DB2?
This topic has been locked.
1 reply Latest Post - 2012-03-17T06:51:27Z by SystemAdmin
Pinned topic Need help with DB2 trigger
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-03-17T06:51:27Z at 2012-03-17T06:51:27Z by SystemAdmin
SystemAdmin 110000D4XK17917 PostsACCEPTED ANSWER
Re: Need help with DB2 trigger2012-03-17T06:51:27Z in response to redridingfraggleI think that your question was answered in
Please try a sample code in #2 by n_i.
n_i also answered your additional questions in #4 and #6.