Hi,
We cannot handle this error in stored procedure. See the following posted details
-------------------------------------------------------------------------
From within TSQL, there is no way to get at the error message itself (i.e you cannot tell what the
substituted table names were). An Open Client client can parse the error message string.
You may be able to figure out what the substituted information was from your context, i.e. if you
do an insert into mytable and get this error, well, you know which table you were just inserting into.
There are a couple long-open feature requesst at Sybase, CRs 58371 and 31148, for this ability.
You can improve the chances they might be acted upon by promoting them through the feature request
ranking system at the International Sybase User's Group website (
http://www.isug.com)
CR 31148: Wants the ability to access error message text (master..sysmessages) from a previous raise error command. Perferably as a global variable.
CR 58371: Would like a way to get error message paramters from within TSQL. Example: 1105 occurs, can get 1105 from @@error, but would like to get the dbname parameter.
-----------------
It would be useful to have a new global variable @@errormsg with gives the
error msg related to @@error
i know msg can be selected fom sysmessages, but that does not give
the exact msg as arguments in that are missing
The way a client app gets the eroor msg , to get it inside the server
would be helpful
Ans:
There is an existing feature request for this, CR 31148
Thanks,
Arun N.