Subject Re: [firebird-support] sql to check if a row has been used in related tables?
Author Stefan Heymann
> a quick and dirty workaround might be:

> if all your fields are defined as foreign keys you can do a delete
> on the master record and get the AffectedRows. If the result is
> bigger than 1 or if an error occurs (if one of the foreign keys is
> not declared as on DELETE CASCADE) then you can be quite sure there
> are dependencies... Do a rollback afterwards if you don't want to
> delete the record in that case.

Wow, what a heck of a hack!

Yeah, I know, Daylight Saving Time can be really hard on the first day
:-))




Regards

Stefan