Subject Re: [ib-support] triggers, referential integrity actions andconstraints execution order
Author Ann W. Harrison
At 07:58 PM 12/11/2002 -0300, IBUNC wrote:
>This example shows ref integ exe order is important:
>
>
>t1.f1 references t2 on delete [RESTRICTED]
>t1.f2 references t2 on delete CASCADE
>
>delete from t2 where f3=2
>
>the transaction does not fail, and deletes both rows.

>If constraints exe order is important ...
>
>What order follows FB?

The order of trigger and constraint execution is controlled
in the module dfw.epp, in the routine setup_triggers. It
currently orders trigger execution with system triggers fired
first, then user triggers in specified order, then constraints -
I'd guess in order of creation, though that could easily be
inverted.

I suppose that the right answer is to allow the designer to
specify the order in which constraints are to be evaluated,
which requires a change to a system table, thus a new ODS.
An alternative is to sort them by type, choosing some order.
I haven't the foggiest notion what order to specify.


Regards,

Ann
www.ibphoenix.com
We have answers.