Subject | Re: [ib-support] triggers, referential integrity actionsandconstraints execution order |
---|---|
Author | Raymond Kennington |
Post date | 2002-12-12T19:20:59Z |
"Ann W. Harrison" wrote:
System BEFORE INSERT
Table BEFORE INSERT
INSERT
Table AFTER INSERT
System AFTER INSERT
and similar for the others; i.e. a sandwich of operation within local trigger
within global trigger.
--
Raymond Kennington
Programming Solutions
W2W Team B
>I'd the order should be for INSERTs:
> 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.
>
System BEFORE INSERT
Table BEFORE INSERT
INSERT
Table AFTER INSERT
System AFTER INSERT
and similar for the others; i.e. a sandwich of operation within local trigger
within global trigger.
--
Raymond Kennington
Programming Solutions
W2W Team B