Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sybase Error Message catching

221 views
Skip to first unread message

diasr...@gmail.com

unread,
Jul 19, 2012, 6:00:08 AM7/19/12
to
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

br...@sybase.com

unread,
Jul 19, 2012, 6:30:48 PM7/19/12
to
On Thursday, July 19, 2012 4:00:08 AM UTC-6, (unknown) wrote:
> 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

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).
0 new messages