Skip to Content
0

How to update the trigger transition variable in the BEFORE UPDATE Trigger

Sep 10, 2017 at 05:11 AM

39

avatar image
Former Member

Hi,

We have a requirement wherein, we need to create a trigger and that trigger should be able to modify a column (LAST_MODIFIED) of the table, on which trigger is created, and puts in a value passed by a procedure.
So, here's what I tried:
CREATE TRIGGER "ABC"."UPDATE_LAST_MODIFIED"
BEFORE UPDATE ON "ABC"."CHANGE_TRACKING"
REFERENCING NEW ROW new_row
FOR EACH ROW
BEGIN
DECLARE PROC_OUTPUT TIMESTAMP;
CALL "_SYS_BIC"."POC.PROCEDURES::SP_TABLE_LAST_MODIFIED_TS" ('SETLINE_CD',PROC_OUTPUT);
new_row.LAST_MODIFIED = PROC_OUTPUT;
END;

This is throwing an error:

single assign is not allowed:

Not sure what's the restriction I am violating here and what's the correct syntax to update the column in the table when an update takes place?

Regards
Debanshu

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers