I'm running RedHat Linux 6.1 (Cartman), Perl version 5.005_03 for i386 Linux,
XBase 1.07, and DBD::XBase 0.160.
Here's the example again:
use DBI;
my $dbh = DBI->connect("DBI:XBase:/directory") || die...;
my $sth = $dbh->prepare("select * from table") || die...;
# This is the part that only takes "milliseconds"
$sth->execute();
# There's no difference in my problem between any fetch method so
# I'll just use fetchrow_arrayref;
# it's when the while() statement returns undef that takes so long...
while ($ref = $sth->fetchrow_arrayref) {
# all of this takes about as much time as you would expect
# until that last fetch. Then it seems to take forever for it
# to return undef on the $ref = $sth->fetchrow_arrayref.
...
}
# I could also just do a $sth->fetchall_arrayref, but it takes just as long.
$sth->finish;
$dbh->disconnect;
exit 0;
"Sterin, Ilya" wrote:
> Phillip did send an example yesterday. Look in your email or the archives.
>
> Ilya Sterin
>
> -----Original Message-----
> From: Honza Pazdziora
> To: Phillip Perkins
> Cc: [EMAIL PROTECTED]
> Sent: 05/02/2001 1:46 AM
> Subject: Re: Last fetch takes forever to undef under XBase
>
> On Tue, May 01, 2001 at 11:36:49AM -0400, Phillip Perkins wrote:
> > Here's a question I hope someone can answer for me. When using DBI to
> > query a table, the query takes only milliseconds. However, if you do
> > any type of fetch on an sth, when you reach the EOF ($sth->fetch is
> > undef), it takes a while before it fails and, for instance, exits a
> > while loop. Same thing happens if you do a fetchall_arrayref. Can
> > anyone explain to me while this takes so long and possibly how to
> > overcome it? By the way, I'm using an XBase connection, so it may be
> > relative to that module.
>
> Moved to dbi-users.
>
> Please mention the name of the driver in Subject, I got to read this
> by a sheer luck.
>
> Please post five line example of this problem, together with version
> numbers of your software -- I'm unable to repeat the behaviour here.
>
> Thanks,
>
> --
> ------------------------------------------------------------------------
> Honza Pazdziora | [EMAIL PROTECTED] | http://www.fi.muni.cz/~adelton/
> .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, DBD::XBase.
> ------------------------------------------------------------------------