Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
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

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 Peppler - Data Migrations Inc. - -
International Sybase User Group -
Sybase on Linux mailing list: