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: Ashutosh Joglekar <ajogleka at LTCM dot COM>
Subject: Re: Queries n rows at a time
Date: Jul 15 1998 3:20PM

Perhaps I have misunderstood the question but isn't it enough to run the query
through $dbh->dbcmd, dbsqlexec (not thru $dbh->sql or siblings). Then run a
dbnextrow loop and in the loop, work with 200 rows at a time, then get the next
20 rows, etc.

Something like :

$dbh->dbcmd($query);
$dbh->dbsqlexec;
$dbh->dbresults;
my ($count) = 0;
while (($col1, $col2, $col3) = $dbh->dbnextrow)
{
    $count++;
    # save $col1, $col2, $col3 into some structure
    if ($count == 200)
    {
        $count = 0;
        # process the batch of rows
    }
}