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: "Raja Sambamurty" <rajags at hotmail dot com>
Subject: Re: standard execution of stored proc
Date: Jun 17 1998 12:02AM

Lee,

this is what I would do (please add any appropriate error checking, 
etc.)

my $SPROCS="sp1,sp2,sp3,sp4";
foreach $sp (split(/,/,$SPROCS) {
   $dbh->sql("exec $sp");
   $spstat = $dbh->dbretstatus;
   if ( $spstat < 0 ) { #unless you're returning your-own code
	die "error in SP $sp";
   }
}

hth

Raja
CSPDBA

>I need to execute several different stored procedures.  Each proc 
>executes update statements.  There should be no data returned except 
for 
>the return code.  It seems to me that I have two options:
>
>1) use sql()
>
>$::dbh->sql("exec proc_update_history")
>
>But, I don't know how to get the return code...
>
>or
>
>2) use standard dbcmd, dbsqlexec, dbresults
>$::dbh->dbcmd("exec proc_update_history");
>$::dbh->dbsqlexec; $::dbh->dbresults;
>$l_status = $::dbh->dbretstatus;
>
>Do I need to do anything with dbnextrow?  If the procedure does return 
>rows because of a select somewhere, I usually want to ignore them.
>
>Thanks
>
>Lee Falkenhagen
>Certified Sybase Professional
>falkenl@hotmail.com
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
>


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com