dbTalk Databases Forums  

trigger problem

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss trigger problem in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Piotr
 
Posts: n/a

Default 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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.