Discussion:
Sybase Error Message catching
(too old to reply)
d***@gmail.com
2012-07-19 10:00:08 UTC
Permalink
In my Sybase PL/SQL block i can get the error code using @@ERROR.
But is there a way to get the error message.

I am looking for an equivalent to Oracle's SQLERRM

Quering sysmessages is not helping.

For Eg.
When i insert NULL in a NOT NULL column i need to catch and display the below error message which i would normally get if i execute the block in ASE ISQL.

'The column ABCD in table XYZ does not allow null values.'

Help appreciated.

Cheers,
Rosh
b***@sybase.com
2012-07-19 22:30:48 UTC
Permalink
Post by d***@gmail.com
But is there a way to get the error message.
I am looking for an equivalent to Oracle's SQLERRM
Quering sysmessages is not helping.
For Eg.
When i insert NULL in a NOT NULL column i need to catch and display the below error message which i would normally get if i execute the block in ASE ISQL.
'The column ABCD in table XYZ does not allow null values.'
Help appreciated.
Cheers,
Rosh
No. The error message text is sent to the client, but there is currently no way to access the full message from SQL. There is an open feature request, CR 296395, for a new global string variable that would contain the full text of the most recently raised error (the message template from sysmessages with values filled in).
Loading...