Subject Re: [firebird-support] Is using SELECT COUNT (*) in a stored procedure a bad idea? (Once Again)
Author Alexandre Benson Smith
At 16:06 27/01/2004 +0100, you wrote:

> > Q: Is there any way to re-write this stored procedure to quit processing
> > table after it finds the first occurrence where the ACTIVITY_TYPE_CODE =
> > 'N'?
> >
> > Q: Is there a better way to trap for FK violations in my interface and not
> > use stored procedures at all?
>Actually, I simply do a:
>.. do delete
> on E:Exception
> do if Pos('FK_<myforeignkeyname>', E.Message) > 0
> then ... show message for this particular foreign key and rollback
>With regards,
>Martijn Tonies
>Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
>Upscene Productions

Hi Martin !

I presume he is not using foreign keys... since he wants to check for the
existance of data in each child table....

Or he does it just to show the proper message ???

By the way... I don't like to show a message based on text (like you did)
but the exception number changes on each "drop/create exception" so there
is no other way... I think will be realy good if FB could store an "error
number" in the user exception and in FK violations, this error should be
constant to be incorporated in the client app...

Anyone has any suggestions about it ???

See you

Alexandre Benson Smith
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.568 / Virus Database: 359 - Release Date: 26/01/2004

[Non-text portions of this message have been removed]