Subject Re: [firebird-support] Is using SELECT COUNT (*) in a stored procedure a bad idea? (Once Again)
Author Martijn Tonies
> Q: Is there any way to re-write this stored procedure to quit processing
the
> 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:

try
.. do delete
except
on E:Exception
do if Pos('FK_<myforeignkeyname>', E.Message) > 0
then ... show message for this particular foreign key and rollback
everything

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com