DB2 LUW latest & greatest 8.2 FP11
Is there any way to dynamically reference the table and/or column name
in a trigger body, perhaps w/ a special register or something?
SP WRITE_AT() is passed: table,PK,operation,user,column,oldval,newval
So instead of:
CREATE TRIGGER UPD_ACCT_NAME
AFTER update of name on account
referencing new as new
referencing old as old
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC
CALL WRITE_AT('account',old.account_id,'U',USER,
'name',old.name,new.name) ;
END !
I want something along the lines of:
CREATE TRIGGER UPD_ACCT_NAME
AFTER update of name on account
referencing new as new
referencing old as old
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC
CALL WRITE_AT(TABLE,old.account_id,'U',USER,
COLUMN,old.name,new.name) ;
END !
TIA
aj