Skip to Content
avatar image
Former Member

Catch RAISEERROR from SQL Anywhere (Trigger) and display the Message in PowerBuilder

Hello,

I have the following statment in an Update/Insert-Trigger:

.....
RAISERROR 18000, 'This is an error Message'
.....


I can catch this error in the dberror-Event in u_dw/u_ds. Here I can also access the errrorcode (18000) via the sqldberror variable. But I don't have a access ont the errormessage ('This is an error Message') which I have defined during calling the RAISERROR in my trigger.

Is there an opportunity to get this message?

Thanks
Heiko

Add comment
10|10000 characters needed characters exceeded

  • FWIW, it's called RAISERROR (just one E)...

    I don't use PowerBuilder so I can't tell whether the error message text is available. However, you might use CREATE MESSAGE to store error code and error text in the catalog (in table SYSUSERMESSAGE) and query that based on the received error code...

    Note, for that usage, the error code must be >= 20000.

  • Get RSS Feed

1 Answer

  • Dec 06, 2016 at 06:52 PM

    This should work. When the raiserror is issues, PB should get the raiserror code back as the SQLDBCode event parameter and in the SQLErrText, an error like:

    SQLState = S1000

    [Sybase][ODBC Driver][SQL Anywhere]RAISERROR executed: This is an error Message

    Add comment
    10|10000 characters needed characters exceeded