Subject | Re: [firebird-support] Detecting which FK has been violated within a SP |
---|---|
Author | Helen Borrie |
Post date | 2006-02-15T04:51:27Z |
At 03:16 PM 15/02/2006, you wrote:
But, in your handler, you can query the primary tables in the same
order of battle to find which key is missing, with the objective of
then raising a custom exception identifying the offending key,
logging out to an external table, or whatever.
./hb
>Hi Group,There won't be a magic context variable. :-)
>
>Simple question that I cant think of the answer. I have a stored
>procedure that does a simple insert
>
>insert into mytable (a,b,c) values (1,2,3);
>
>I want to catch foreign key violations in a when ... do block. But I
>need to know which of the foreign keys has been violated. Is there a
>way to do this?
But, in your handler, you can query the primary tables in the same
order of battle to find which key is missing, with the objective of
then raising a custom exception identifying the offending key,
logging out to an external table, or whatever.
./hb