Subject | Re: [IBO] Display Exception message description raised From SP/Trigger |
---|---|
Author | Geoff Worboys |
Post date | 2001-03-03T03:17:42Z |
> There i have defined no of Exception like following<...>
>
> CREATE EXCEPTION CHEQUE_NOT_ISSUED 'Cheque is not from
> Issued Cheque Books'
> Can somebody help me in showing the message defined inUsing only the facilities provided, your only choice is to extract the
> exception definition ?
message from the multiple lines of text returned. My own little test
of this shows that EIB_ISCError.ErrorMessage returned the following...
- - - -
ISC ERROR CODE:335544517
ISC ERROR MESSAGE:
exception 1
This is a Test Error
STATEMENT:
TIB_DSQL: "IB_Script."
- - - -
As you can see the actual exception message occurs on the 5th line.
Your processing of EIB_ISCError needs to go something like...
on E: EIB_ISCError do
begin
if (E.ErrCode = isc_except) and
(E.ErrorMessage.Count >= 5) then
desc := E.ErrorMessage.Strings[4]
else
...
Notice that all developer defined database exceptions get returned
using the same errcode isc_except.
PS. I have not tested the above code, but it should be close :-)
HTH
Geoff Worboys
Telesis Computing