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: Question about retrieving "output" procedure parameters
Date: Jan 18 2001 9:10PM

Redway, Michele writes:
 > Hi, there... the documentation states the following:
 > 
 > =================
 > @dat = $dbh->dbretdata[$doAssoc])
 > 
 >      Retrieve the value of the parameters marked as 'OUTPUT' in a stored
 > procedure. If $doAssoc is non-0, then retrieve the data as an associative
 > array with parameter name/value pairs. 
 > =================
 > 
 > It works fine, but the names of the parameters are not returned when
 > $doAssoc is 1. Instead, I get "Par 1" and Par 2".
 > 
 > Perhaps I'm doing something wrong...?

Whether the parameter names are available when you fetch the OUTPUT
data with dbretdata() depends on how the proc was called.

If you use the dbrpcinit()/dbrpcparam() API calls to set up the stored
proc call you will get the parameter names, and if you use the
language calls and define the names before hand like so you should
also get the names:

$sql = "declare \@param1 varchar
exec foo_proc \@param1 = \@param1 OUTPUT
";
$dbh->dbcmd($sql);
etc.

At least I think so.

In any case I only return whatever Sybase sends back (at least I think
so - I haven't looked at that part of the code in a *long* time :-)

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