trigger problem -
08-28-2003
, 05:12 AM
Hello,
I would like to make history database using triggers and I get a following
error executing such code:
CREATE TRIGGER piotr.rec_hist AFTER UPDATE OF field_1 ON piotr.tab_1
REFERENCING NEW_TABLE AS n FOR EACH ROW MODE DB2SQL BEGIN ATOMIC
INSERT INTO piotr.hist_tab (who, when, chng)
VALUES (USER, CURRENT TIMESTAMP, n.field_1);
END
I get following error:
[IBM][CLI Driver][DB2/LINUX] SQL0206N "N.FIELD_1" is not valid in the
context where it is used. LINE NUMBER=2. SQLSTATE=42703
This is example from DB2 documentation. What am I doing wrong ?
Regards
Piotr |