Subject | Re: Handling Exceptions in Stored Procedures |
---|---|
Author | Adam |
Post date | 2005-05-05T03:09:59Z |
The line:
when exception do
change exception to the exception you want to be catching or any
eg:
when any do
Also it helps to post the error text rather than a broad it doesn't
compile type message.
Hope that helps
Adam
--- In firebird-support@yahoogroups.com, "robertgilland"
<robert_gilland@b...> wrote:
when exception do
change exception to the exception you want to be catching or any
eg:
when any do
Also it helps to post the error text rather than a broad it doesn't
compile type message.
Hope that helps
Adam
--- In firebird-support@yahoogroups.com, "robertgilland"
<robert_gilland@b...> wrote:
> Is there an Example . Itried the following and I could not get itto
> compile.
> Any Ideas?
> CREATE PROCEDURE PROC_INJECT_PLUSALES
> (
> ASTOREID VARCHAR(10),
> ASALESDATE TIMESTAMP,
> APLU VARCHAR(14),
> AQUANTITYSOLD FLOAT,
> ASALESEXGST FLOAT,
> ACOSTEXGST FLOAT,
> ASALESINCGST FLOAT,
> ACOSTINCGST FLOAT
> )
> AS
> BEGIN
> INSERT INTO PLUSALES
> ( STOREID, SALESDATE, PLU,
> QUANTITYSOLD, SALESEXGST,
> COSTEXGST, SALESINCGST, COSTINCGST )
> VALUES
> ( :ASTOREID, :ASALESDATE, :APLU,
> :AQUANTITYSOLD, :ASALESEXGST,
> :ACOSTEXGST, :ASALESINCGST, :ACOSTINCGST );
> WHEN EXCEPTION DO
> BEGIN
> UPDATE PLUSALES
> SET
> QUANTITYSOLD = :AQUANTITYSOLD,
> SALESEXGST = :ASALESEXGST,
> COSTEXGST = :ACOSTEXGST,
> SALESINCGST = :ASALESINCGST,
> COSTINCGST = :ACOSTINCGST
> WHERE
> ( STOREID = :ASTOREID )AND
> ( SALESDATE = :ASALESDATE )AND
> ( PLU = :APLU );
> END
> END;