If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > Sybase IQ error handling - please help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-04-11, 12:22
deepak pv deepak pv is offline
Registered User
 
Join Date: Apr 2011
Posts: 1
Sybase IQ error handling - please help

Hi All,

I am using sybase iq 15.1 and i am new to this. I have a problem in capturing the return code of the procedure.

I have a main sp which calls another sp. I am not able to capture the return code of the second sp.

sample code.

create procedure main
as
begin
declare @rc int
....
....
execute sub_proc @var1 @var2
set @rc = @@error
if @rc != 0
print 'Faied'

end

The second proc is throwing error
sql anywhere error -638: right truncation of string data.

Please adviced how to capture this error in main proc and return the message.
Thanks in advance.

Deepak
Reply With Quote
  #2 (permalink)  
Old 04-12-11, 02:15
dinjo_jo dinjo_jo is offline
Registered User
 
Join Date: May 2008
Posts: 34
Your called procedure should have a return condition.

Code:
RETURN @@error
And then while calling the proc

Code:
EXEC @error = CalledProc @param1 , @param1
Then check against @error
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On