Subject RE: [firebird-support] multiple inserts in trigger
Author Helen Borrie
At 09:52 PM 11/07/2007, you wrote:
>Hello,
>
> Guess I am being slow this morning, why handle NULLS, should they not be
>a miss-compare and thus write a record to the secondary table (audit table)?

Nope.

if (old.something <> new.something) returns false if one of them is
null. Null isn't a value, it is a state.

>Do not understand infinite recursion to check for. Basically the trigger is
>fired once when the mrp screen moves to another screen.

The trigger is fired once after every update of table XXXX. It isn't
connected to what your user interface is doing at all. If there is no
update, the trigger will never fire. If there is an update, the
trigger will always fire.

>During that time 1
>or more fields could have been changed (I get one trigger for many updates)

...you get all update triggers firing for *each* update...

>at that point I test the fields and update ones that are appropriate. Could
>you please explain in a little more detail.

If your trigger performs an update on the same table that owns the
trigger (bad, bad idea!) you will get infinite recursion. You will
also get a knotty situation if the tables the trigger is updating
have triggers of their own that fire stuff back at table XXXX.

./heLen