Subject | Re: [firebird-support] Is using SELECT COUNT (*) in a stored procedure a bad idea? (Once Again) |
---|---|
Author | Alexandre Benson Smith |
Post date | 2004-01-27T16:38:45Z |
At 16:06 27/01/2004 +0100, you wrote:
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
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
----------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.568 / Virus Database: 359 - Release Date: 26/01/2004
[Non-text portions of this message have been removed]
> > Q: Is there any way to re-write this stored procedure to quit processingHi Martin !
>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
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
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
----------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.568 / Virus Database: 359 - Release Date: 26/01/2004
[Non-text portions of this message have been removed]