I am trying to create this trigger that is updating the time and data in a table when a flag is changed in another table. This is the trigger.
The erros is : This statemens is not allowed.
Any ideas how can i make it work?
CREATE TRIGGER name
BEFORE UPDATE ON table
REFERENCING OLD AS OLDVAL
NEW AS NEWVAL
FOR EACH ROW
when (OLDVAL.flag != NEWVAL.flag )
SET (FEADAT,FEATIM) = (CURRENT DATE, SUBSTR(CAST(current time AS CHAR(8)),1,2) || SUBSTR(CAST(current time AS CHAR(8)),4,2) )
WHERE other_table.id =NEWVAL.id ;