Subject Re: [firebird-support] On Update/Delete Cascade
Author Ann W. Harrison
Cipto wrote:
> ...the master table (Table A), and 3 detail table (Table B,C,D). Each
> detail table has a foreign key to the primary key of master table (Table A)
> and have a cascade on update and delete. If I change the primary key of
> able A, then Firebird will trigger the on update trigger on table
> B,C,and D. The question is, which detail table (B,C,D) will be
> execute first??

That's not deterministic. It depends on the order in which the
constraints were declared, and I think the constraints are executed in
inverse order of declaration. But that order is totally an
implementation artifact and may change in different versions of Firebird.

> Is it one by one (example: first table B,
> then table C and last table D)

Yes. One at a time in some order.

> or Firebird will execute the 3 detail table
> in the same time with separated thread??

No. At the moment, Firebird never splits execution threads.