Exception Handling

Ivan Smahin ivan_smahin at paradigmasoft.com
Mon Feb 16 03:24:13 CST 2009


Hello Ivan,

Monday, February 16, 2009, 10:40:28 AM, you wrote:

> Hello Bart,

> Friday, February 13, 2009, 5:06:18 PM, you wrote:

>> Hi List, Ruslan,


>> In an exception block within a stored procedure can I do this:
>> begin


>> exception
>> when 56503 then
>>         leave
>> when others then
>>         print 'Error has occured: procedurename: ' || err_name


>> end

>> the question is about the err_name; can I use err_name to have  
>> description of the exception (ie: ERR_CONSTRAINT_UNIQUE_VIOLATION) ?

>> This way we could use the log to correct untrapped exceptions in an SP

> Sorry for delay.

>          print 'Error has occured: procedurename: ' || Hex(@@LastErrorNumber)


Not exactly what you want...

It should be something like this one:

select fld_ErrorName from (SHOW vERRORS) WHERE fld_ErrorCode = @@LastErrorNumber




-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list