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: LNowak at aol dot com
Subject: How to handle 4 resluts sets?
Date: May 8 2000 2:42PM

Hello

I have been using sybperl for some time now... and I have never had to 
retrieve more than one result set. Over the weekend I was hammering out some 
code and I ran into this problem sp_help "". Now we all know the 
sp_help returns 4 result sets - this is code I am using:

use Sybase::DBlib;
#"Some code here ****

$dbh->dbcmd("sp_help $table_name[$i]");
$Exec_status = $dbh->dbsqlexec;
$Results_status = $dbh->dbresults;

while(%Table_data = $dbh->dbnextrow(1))
{
      
            $Column_name = $Table_data{Column_name};
        $Type = $Table_data{Type};
        $Length = $Table_data{Length};
        
        print OUTFILE "$table_name[$i],$Column_name,$Type,$Length\n";           
           
}     

#"Some More code here ****

The code above works no problem with 1 result set but 2+ result sets it spits 
out some error messages or loses the second, third etc. result set... This 
more of curious question on how to handle more than one result set - do I 
need to start using dbpoll and dbsqlok? If someone could point me in correct 
direction - it would be appreciated.

Thanxs
Leigh