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 mbay dot net>
Subject: DBD::Sybase and return values from SP's
Date: Nov 16 1998 2:32PM

Bill Middleton writes:
 > 
 > 
 > Hi,
 > 
 >   I'm trying to figure out how to get the output value from
 > a stored procedure using DBI, or DBlib,  or at least, without having
 > to physically install the parameter using CTlib.  I have a
 > SP which declares two variables, one input and one output.
 > I can exec the thing with DBD::Sybase using:
 > 
 > my $sql = "exec test_results \"$input\",\"\"";
 > $sth = $d->prepare($sql);
 > $sth->execute;

To get an OUTPUT value you need to pass it in when you make the call
(this assumes that the OUTPUT param is a char or varchar):

my $sql = qq{
declare \@param varchar(50)
exec test_results "$input", \@param OUTPUT
};

Now when you execute this (with any of the interfaces) you will get an 
additional result set with the @param output.

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