Subject | Re: [ib-support] Exception when updating |
---|---|
Author | Helen Borrie |
Post date | 2002-11-12T04:27:47Z |
At 05:26 PM 11-11-02 -0600, you wrote:
application by reading the status vector that is returned to the API when
an exception occurs.
There are also features in the procedural language (PSQL) which enable you
to trap exceptions in your code and handle them there. You trap the
exception in a WHEN...DO structure and then handle it in an isolated block
of code to which control will jump when an exception occurs. You could,
for example, write a message out to a log file and then just let execution
of the procedure continue.
As well as the exceptions that the engine knows about, you can define
custom exceptions with a CREATE EXCEPTION <exception name> 'Some message
string' statement in your metadata. In your procedure code, you then cause
that exception to occur by an EXCEPTION <exception name> statement. When
that exception occurs, you can handle it inside the procedure similarly to
how you would handle an internally defined exception.
If you don't handle it, the message string you defined for the exception
will be passed back to the client in the status vector, where your
application's exception handling can monitor for it and handle it.
heLen
>With FireBird what happens if you are doing an SQL update and you get anThe engine generates exceptions which you can handle in your client
>error or exception. Is there a mechanism whereby you can
>log to error and continue on with the update.
application by reading the status vector that is returned to the API when
an exception occurs.
There are also features in the procedural language (PSQL) which enable you
to trap exceptions in your code and handle them there. You trap the
exception in a WHEN...DO structure and then handle it in an isolated block
of code to which control will jump when an exception occurs. You could,
for example, write a message out to a log file and then just let execution
of the procedure continue.
As well as the exceptions that the engine knows about, you can define
custom exceptions with a CREATE EXCEPTION <exception name> 'Some message
string' statement in your metadata. In your procedure code, you then cause
that exception to occur by an EXCEPTION <exception name> statement. When
that exception occurs, you can handle it inside the procedure similarly to
how you would handle an internally defined exception.
If you don't handle it, the message string you defined for the exception
will be passed back to the client in the status vector, where your
application's exception handling can monitor for it and handle it.
heLen