Subject Re: [firebird-support] Testing Foreign Key References Before Delete?
Author Helen Borrie
At 20:16 26/07/2008, you wrote:
>Hi Folks:
> Using current IBPP and Firebird.
> We all know Firebird will complain if a user attempts to
>delete a record that violates a foreign key reference
> Is there a way for to find out if a delete will cause
>a problem,

The normal strategy is to let the exception happen, catch it and respond appropriately.

>and what tables and records will have a problem?

What would a "problem" be for you? The purpose of the constraint is to constrain, i.e., to preempt something happening that would break referential integrity. If that protection is threatened, the database reacts to prevent it by throwing an exception. So it's over to you to anticipate the exceptions that would occur if the constraint were challenged and provide the means to make it this case, catching the exception and telling the user the record can't be deleted because other records exist that depend on it.