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: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: execution of stored procedure - output values
Date: Jan 26 2000 10:44PM

Stephane_Pelchat@WellspringRes.com writes:
 >
 > 	1-  Is it possible to process a result set from a stored proc, is it
 > any different from a dbresults/dbnextrow loop?

No - you process the results as usual. Make sure that you call
dbresults() in the outer loop until it returns NO_MORE_RESULTS.

 > 	2-  Is it possible to use output parameters of a stored proc?  For
 > example a parameter "error_message VARCHAR(255) out"

Yes. Basically you need to do this:

$db->dbcmd("
declare \@error_message varchar(255)
exec the_proc .... \@error_message = \@error_message OUTPUT
");

Now when you fetch the results via dbnextrow() you will get one row
with the @error_message.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com