Subject Re: [firebird-support] How to get last error message in a procedure 2
Author Helen Borrie
At 05:30 AM 3/05/2005 +0000, you wrote:
>I thought that maybe some guys/girls who know the answer to my question
>below were at vacation when i first posted it, so here it comes
>again :)
>
> > Hi
> >
> > I want to catch any exception in a stored procedure, then concatenate
> > the error message with additional info and then raise exception with
> > more info. How to get error message of last exception?
>
>... is it possible at all?

It's *possible* with v.1.5, but would be quite a lot of work. It would
also be limited to 78 bytes ascii. (The length limit goes up to 1021
bytes in Fb 2).

In 1.5 you can get either the gdscode or the sqlcode as a context variable,
inside a handler that is in the scope of the code where the exception
occurred. You would need to create a table (sqlcode, gdscode,
text_of_message) in the database to look up the text of the message during
execution of your error handler.

./heLen