Subject Re: [Firebird-Architect] Re: NOT UPDATABLE fields
Author Ann W. Harrison
Dmitry Yemanov wrote:

comparing this syntax from the 99 standard:

>>>CREATE TRIGGER bla ON myTable AFTER UPDATE
>>>WHEN old.protectedCol1 IS DISTINCT FROM new.protectedCol1
>>>OR old.protectedCol2 IS DISTINCT FROM new.protectedCol2
>>>AS BEGIN
>>> RAISE myException;
>>>END

with this syntax which we currently support:

>>CREATE TRIGGER blah ON mytable AFTER UPDATE
>>AS BEGIN
>> IF ((old.protectedCol1 IS DISTINCT FROM new.protectedCol1)
>> OR (old.protectedCol2 IS DISTINCT FROM new.protectedCol2))
>> THEN RAISE myException;
>>END
>
>
> 1) No need to copy the record to/from OLD/NEW

How does the condition in the WHEN clause get evaluated if the record is
not copied?

> 2) No need to execute a trigger at all (nested looper call and savepoints
> creation are avoided)

The trigger is specified as occurring after update. How can we avoid
doing the update, thus creating the undo log?
>
It appears that you are suggesting that we ignore the before/after
specification on trigger execution. That seems most unwise.


Regards,


Ann