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: "Lee Falkenhagen" <falkenl at hotmail dot com>
Subject: Re: standard execution of stored proc
Date: Jun 17 1998 2:25AM

Okay, so that works pretty well.  Why would you ever want to use dbcmd, 
dbsqlexec, and dbresults if you can do the same thing with nsql or sql?  
It looks like even multi statement sql works with the sql command.

Thanks

>From owner-sybperl-l@listproc.net Tue Jun 16 14:06:23 1998
>Received: from localhost (localhost [127.0.0.1])
>	by list.cren.net (8.8.7/8.8.7) with SMTP id QAA19875;
>	Tue, 16 Jun 1998 16:46:32 -0400 (EDT)
>Received: from hotmail.com (f197.hotmail.com [207.82.251.86])
>	by list.cren.net (8.8.7/8.8.7) with SMTP id QAA19864
>	for ; Tue, 16 Jun 1998 16:46:27 -0400 (EDT)
>Received: (qmail 22229 invoked by uid 0); 16 Jun 1998 20:45:58 -0000
>Message-ID: <19980616204558.22228.qmail@hotmail.com>
>Received: from 207.25.52.68 by www.hotmail.com with HTTP;
>	Tue, 16 Jun 1998 13:45:58 PDT
>X-Originating-IP: [207.25.52.68]
>From: "Raja Sambamurty" 
>To: SybPerl Discussion List 
>Subject: Re: standard execution of stored proc
>Content-Type: text/plain
>Date: Tue, 16 Jun 1998 13:45:58 PDT
>Reply-To: SYBPERL-L@listproc.net
>Sender: owner-SYBPERL-L@listproc.net
>X-Listprocessor-Version: 8.2.06 -- ListProc(tm) by CREN
>
>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
>
>


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