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: DBlib and Stored Procedures
Date: Aug 8 1999 8:43PM

sql() will return a reference to an array, with each of the rows
returned by the proc as the elements of the array.

If you need more control you should code a loop like so:

while($dbh->dbresults != NO_MORE_RESULTS) {
   while(@data = $dbh->dbnextrow) {
       ... do something with it here....
   }
}

Michael

Ellery, Michael BGI SF wrote:
> 
> I'm trying to figure out the easiest way to execute a stored procedure using
> Sybase::DBlib and get the results back (in a reference or an array).  For
> instance, if I do something like
> 
> $dbh->sql("exec $DATABASE..IU_fi_lbkl_issue_SP '$param_1', '$param_2' ");
> 
> ..is there some way that I can get the results from my SP (assuming I return
> the values using some sort of select statement at the end of the SP)?
> 
> I'd prefer to be using CTlib, but I'm stuck with having to use DBlib at the
> moment...any advice is appreciated.
> 
> Michael Ellery
> Barclays Global Investors
> 45 Fremont St., 6th Floor #102
> San Francisco, CA  94105
> (415) 908-7234 [PH],  (415) 597-2352 [FAX]
> Email:  michael.ellery@barclaysglobal.com