Page 1 of 1

Stored Procedure - Capturing error codes

Posted: Fri Jan 25, 2008 9:59 am
by turash
I have a Sybase stored procedure which does insert in 3 tables. I am calling the stored procedure using SYBASE OC stage.

I need to capture Successful completion or custom error code and message thrown by the stored procedure . These informations are inserted in the tracking table.

I am using Following to generate custom error

Code: Select all

RAISERROR 20020 'Custom message'
All these message are getting logged in Datastage Log.

Thanks in advance!

Posted: Mon Jan 28, 2008 7:46 pm
by Teej
You need to build in a return code and catch all the throws and handle it within that.

Posted: Mon Jan 28, 2008 7:47 pm
by Teej
You need to build in a return code and catch all the throws and handle it within that.

Posted: Tue Jan 29, 2008 1:02 am
by SHARAD123
Jus pass the error message back with a variable. Then try inserting the variable to the required table.