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: Doug Fairclough <kensey at wired dot com>
Subject: RE: Executing stored procedures with parameters
Date: Mar 20 1996 5:49PM

> There are 2 ways to do it.  The most efficient is to use a remote procedure
> call.
>

why is that ?  is it more efficient in all cases (ie - even when you are
not returning parameters ? )

thanks.

doug
 
> 
> 
> $dbh->dbrpcinit("test_proc", 0);
> $in='some stuff';
> $dbh->dbrpcparam("\@in",0,SYBCHAR,-1,length($in),$in);
> $dbh->dbrpcparam("\@out", DBRPCRETURN, SYBINT4, -1, -1, 0) ;
> $dbh->dbrpcsend ;
> @dat=$dbh->dbretdata;
> print ("parms= ",@dat,"\n");
> 
> The other way is to execute the stored procedure as a normal SQL command:
> Note that here you have to declare a variable (@junk) for the exec even though
> it does nothing.
> 
> $dbh->dbcmd("declare \@junk int\n");
> $dbh->dbcmd("exec test_proc \@in='some stuff',\@out=\@junk output");
> $dbh->dbsqlexec;
> @dat=$dbh->dbretdata;
> print ("parms= ",@dat,"\n");
> 
>