By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,586 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,586 IT Pros & Developers. It's quick & easy.

DB2 Trigger syntax

P: 1
Hi,

I'm new to DB2 from SQL Server, There's a problem with the syntax below, is anyone able to see what the issue is?

CREATE TRIGGER AUDIT
AFTER UPDATE ON ABEFORE
REFERENCING OLD AS O
FOR EACH ROW MODE DB2SQL
WHEN ('YES' IN SELECT CONTROLFLAG FROM TRIGGERCONTROL WHERE TRIGGERNAME = 'AUDIT')
BEGIN ATOMIC
INSERT INTO AAFTER (AAFTERID,NAME,TIMESTAMP) VALUES (O.ABEFOREID,O.NAME,CURRENT TIMESTAMP);
END;

I have a table called ABEFORE and a table called AAFTER, the insert statement works fine when I pass in 1,'TEST' CURRENT TIMESTAMP

Any help would be appreciated.
Jun 20 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.