Subject | Re: [firebird-support] sql to check if a row has been used in related tables? |
---|---|
Author | Stefan Heymann |
Post date | 2007-03-26T16:02:22Z |
> a quick and dirty workaround might be:Wow, what a heck of a hack!
> 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.
Yeah, I know, Daylight Saving Time can be really hard on the first day
:-))
Regards
Stefan