Skip to content Skip to sidebar Skip to footer

Trigger On Update Firebird

Whenever the field sync is updated without the flag being YES I need to set that field to NULL. CREATE TRIGGER my_trigger FOR customers AFTER UPDATE as BEGIN if(new.sync <> '

Solution 1:

Solved.

Some code was missing but besides that also the logic. I needed to used BEFORE and not AFTER.

SET TERM !; 
CREATETRIGGER my_trigger FOR customers 
BEFORE UPDATE 
POSITION 0ASBEGIN 
    IF(new.sync <>'YES') THENBEGIN 
        new.sync =NULL; 
    ENDEND;

Post a Comment for "Trigger On Update Firebird"