Hi,
Thanks for your immediate reply.
I modified the trigger as below.
CREATE TRIGGER TUB_POC1
NO CASCADE
BEFORE INSERT
ON TABLE POC1
REFERENCING NEW AS N
FOR EACH ROW
MODE DB2SQL
N.POC_COL2 = CURRENT TIMESTAMP;
I am getting following error now.
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "REFERENCING". SOME SYMBOLS
THAT MIGHT BE LEGAL ARE: OLD, NEW, OLD_TABLE, NEW_TABLE
DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNHSM5R SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 0 0 0 -1 289 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF'
What we are trying to do is update a timestamp field before inserting any new row. Can we update the same table data on update trigger?
Thanks
santhi
Quote:
Originally posted by disaster
Hi Santhi,
marc again.
a little example:
create trigger (triggername)
no cascade before (activation time)
update (trigger event)
of (columnname) on (tablename)
referencing old as old
new as new
for each row (granularity)
mode db2sql (shit needed by db2)
when (trigger condition) condition
begin atomic (trigger action ends with ';')
end@ (you must alter the sql terminator to a different sign than ';'
for example '@')
This is only an example !
regards
marc
|