Subject Re: [Firebird-Architect] Order of check triggers for foreign keys
Author Martijn Tonies
> > > 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.

Aha. Indeed, this I would not expect :-)

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Upscene Productions