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: Re: results pending query
Date: Jan 27 1999 5:26PM

1.
$dbproc = Sybase::DBlib->dblogin('sa', 'wishb0ne', 'cdlive');
$dbproc->dbcmd('select customer_name, customer_number from
customerdb..CUSTOMER where customer_number in (2201278, 2201279)');
$dbproc->dbsqlexec;
$dbproc->dbresults;
while ( %dat = $dbproc->dbnextrow(1))
 {
     print "$dat{customer_number}, $dat{customer_name}\n";
}
$dbproc->dbclose();

This runs fine and gives me back multiple rows


2.
$dbproc = Sybase::DBlib->dblogin('sa', 'wishb0ne', 'cdlive');
@custnumber=$dbproc->nsql('exec customerdb_audit..ajd1', "ARRAY");
foreach  $custnumber ( @custnumber )
{
     $dbproc->dbcmd("exec customerdb..spGetCustDetails $custnumber");
     $dbproc->dbsqlexec;
               while ( %dat = $dbproc->dbnextrow(1))
               {

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

                }
}
          $dbproc->dbclose();


This gives me the results pending error.


3.
$dbproc = Sybase::DBlib->dblogin('sa', 'wishb0ne', 'cdlive');
@custnumber=$dbproc->nsql('exec customerdb_audit..ajd1', "ARRAY");
foreach  $custnumber ( @custnumber )
{
     $dbproc->dbcmd("exec customerdb..spGetCustDetails $custnumber");
     $dbproc->dbsqlexec;
     while ( $dbproc->dbresults != NO_MORE_RESULTS )
     {
               while ( %dat = $dbproc->dbnextrow(1))
               {

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

                }
     }
}
          $dbproc->dbclose();
This gives me one row then 2 emtpy ones and then hangs.



Should I be looking at the stored procs.
I have tried these on the SQL server and they run OK.


Any ideas ?
thx