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: "Andrew J Davies" <Andrew dot J dot Davies at aib dot ie>
Subject: results pending query
Date: Jan 27 1999 2:27PM

Hi All
Hope you can shed some light on this.

I am relatively new to sybperl/perl so please excuse my ignorance.

I am trying to run the following:

$dbproc = Sybase::DBlib->dblogin('sa', 'wishb0ne', 'cdlive');
$dbproc->dbuse('customerdb_audit');

#Get list of new customer numbers

@custnumber=$dbproc->nsql('exec ajd1', "ARRAY");    # test proc ajd
produces a list of numbers 4545454, 5657747 etc..
iforeach  $custnumber ( @custnumber )
{
     $dbproc->dbcmd("exec customerdb..spGetCustomerAllDetailsByCustID
$custnumber");
     $dbproc->dbsqlexec;
     $dbproc->dbresults;
          while (%dat = $dbproc->dbnextrow(1))
              {

           print "$dat{customer_number}, $dat{customer_name},
$dat{address_line2}\n";

              }
}

The procedure spGetCustomerAllDetailsByCustID is a wrapper for several
other stored procs.
eg:
spGetCustomerAllDetailsByCustID calls......
spGetCustomerAddressByCustID .....spGetCustomerBankDetailsByCustID etc.....

When I run the code I get the first customer details OK. But then a message
 saying Sybase Error: Attempt to initiate new SQL operation with results
pending.

Am I on the right track ?????????
Can I pull back multiple results sets into %dat.


Many thanks
Andy