Subject | Re: Testing Foreign Key References Before Delete? |
---|---|
Author | inoffensive_2006 |
Post date | 2008-07-26T11:10:08Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...> wrote:
Thanks Again Helen:
That's what I thought.
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 right...in this case,
catching the exception and telling the user the record can't be
deleted because other records exist that depend on it.
I was wondering if, after specifying the constraints, Firebird
could be used to save me the task identify potential violations. Such
a service would offer the advantage of avoiding overlooking a constraint.
As always, I appreciate your expert advice.
Thanks
Larry
>respond appropriately.
> 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
> >constraint.
> >
> > 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
Thanks Again Helen:
That's what I thought.
> >and what tables and records will have a problem?to constrain, i.e., to preempt something happening that would break
>
> What would a "problem" be for you? The purpose of the constraint is
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 right...in this case,
catching the exception and telling the user the record can't be
deleted because other records exist that depend on it.
I was wondering if, after specifying the constraints, Firebird
could be used to save me the task identify potential violations. Such
a service would offer the advantage of avoiding overlooking a constraint.
As always, I appreciate your expert advice.
Thanks
Larry