DB2 Trigger question Forgive my newbieness. I am created 2 tables EMP_DAN table and
EMP_DAN_AUDIT. I am trying to create a trigger that anytime something
is inserted or updated on the EMP_DAN table it will record a the
change and timestamp on the AUDIT table. Here is the code i'm using
which does not execute:
CREATE TRIGGER NEW_TS1
BEFORE UPDATE ON Emp_Dan
REFERENCING OLD AS newTimeStamp
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC
INSERT INTO EMP_DAN_AUDIT VALUES (newTimeStamp.EMPNO,
newTimeStamp.FIRSTNME, newTimeStamp.MIDINIT, newTimeStamp.LASTNAME,
newTimeSta
mp.WORKDEPT, newTimeStamp.PHONENO, newTimeStamp.HIREDATE,
newTimeStamp.JOB, newTimeStamp.EDLEVEL, newTimeStamp.SEX,
newTimeStamp.BIR
THDATE, newTimeStamp.SALARY, newTimeStamp.BONUS, newTimeStamp.COMM,
current timestamp);
It gives an error saying "An unexpected token "END-OF-STATEMENT" was
found following ",
current timestamp)". Expected tokens may include:
"<delim_semicolon>"." Help me please... |