Stored Procedure - Capturing error codes

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
turash
Premium Member
Premium Member
Posts: 51
Joined: Fri Apr 06, 2007 10:09 am
Location: Edison, NJ

Stored Procedure - Capturing error codes

Post 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!
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

You need to build in a return code and catch all the throws and handle it within that.
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

You need to build in a return code and catch all the throws and handle it within that.
SHARAD123
Premium Member
Premium Member
Posts: 54
Joined: Wed Jan 09, 2008 12:05 am

Post by SHARAD123 »

Jus pass the error message back with a variable. Then try inserting the variable to the required table.
222102
Post Reply