Subject Re: [Firebird-Architect] Order of check triggers for foreign keys
Author Ann W. Harrison
At 05:26 PM 12/8/2004, Martijn Tonies wrote:

> > It's working - that is, at the end of the delete of the
> > record in the referenced table, everything is consistent
> > again. There is a point in the middle of the verb when
> > referencing records can notice that they're orphaned.
> > That's not great.
>
>Exactly when, and why?

The child (aka referencing) table has a pre-delete trigger
which does a lookup on the parent (aka referenced) table
using its foreign key value. If the parent record exists,
the trigger logs 'found it!'. If not, it logs 'Where''s Mommy?',
or something like that. Since the child delete is done
after the parent is gone, there's lots of whimpering going
on in the log.

Regards,


Ann