PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: bruno dot georges at barclayscapital dot com
Subject: Handling Return Codes from Stored Procedures
Date: Aug 2 1999 8:48AM

Hi,

I am using SybPerl to execute a stored Procedure and return the results as
follows:

$dbq = "exec stored_procedure name"."\n";
($dbh->ct_execute($dbq) == CS_SUCCEED) or die "Cannot execute query";
($dbh->ct_results($resType) == CS_SUCCEED) or die "Cannot access source
ct_results (CS_SUCCEED 1)";
($resType == CS_ROW_RESULT) or die "Cannot access source result type
(CS_ROW_RESULT)";

my @names = $dbh->ct_col_names();
my %dat = ();

While( %dat = $dbh->ct_fetch( 1 ) ) {
	...................................


I would be grateful if you could tell me how I can test for a specified
error code from the stored procedure, which is returned either through
raiserror or through a return statement, as follows:


              SELECT * 
   		   FROM 
                    RoutingRule 
               WHERE  
                    TeamID=@TeamID 
              ) 
          BEGIN 
              raiserror  20337 "Error Deleting Action Team . Team In A
RoutingRule ? proc 'spDeleteActionTeam'" 
              return -20337 
          END 


Thanks	

Trevor

--------------------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.

Internet communications are not secure and therefore the Barclays Group
does not accept legal responsibility for the contents of this message.
Any views or opinions presented are solely those of the author and do 
not necessarily represent those of the Barclays Group unless otherwise 
specifically stated.

--------------------------------------------------------------------------------------