Subject RE: [firebird-support] problem with before update trigger
Author Leyne, Sean
Maurizio,

> in a table i have a field 'testupdated' ,
> in the same table in the before update event i have
> a trigger : ' mytable.testupdated = 'S' ,
> of course i can''t set its value to 'N' ......that trigger will change
> it in 'S' ,
> is it possible to exclude fields from that event ?
> .... in other words : don't fire the trigger when the field
> 'testupdated' changes .

No, it is not possible.

Triggers fire based on the entire operation, not based on change to selected fields/columns.

You would need to add logic to the trigger to determine whether you want the "meat" of the trigger to execute.

Ie.

CREATE TRIGGER ...
AS
BEGIN
IF (NEW.testupdated IS NOT DISTINCT FROM OLD.testupdated) THEN BEGIN
... do some logic
END

END


Sean