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 <> 'YES')
then new.sync = NULL;
end
But I keep receiving the error:
Dynamic SQL Error SQL error code = -104 Unexpected end of command - line 6, column 26
I believe line 6 is then new.sync = NULL
? I thought the problem might be the use of ;
but it's not, because if I remove it then it gives the same error but in the line 7.