Thanks Steven,
But all I can see on this talk (on slide 89?) is the new syntax of
fetchall_arrayref, which is already used in my example.
I was looking for a better way to construct a while loop with
fetchall_arrayref. The problem is that when you fetch the last lot of data,
the statement handle becomes inactive, but you still have an reference to
your last set of data. Contrast this with a fetchrow_arrayref loop, which
has no data to return on the last fetch, so the reference is undef and the
loop exits cleanly, ie
while ( my $array_ref=$sth->fetchrow_arrayref()) {
# ... do something
}
works, but
while ( my $array_ref=$sth->fetchall_arrayref(undef, $maxfetch)) {
# ... do something in a loop
}
doesn't
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 8:33 AM
To: '[EMAIL PROTECTED]'
Subject: Re: What is the best way to use maxrows in fetchall_arrayref?
-- "Fox, Michael" <[EMAIL PROTECTED]> on 08/14/02 08:07:44 +1000
>
> Any thoughts on using the new DBI feature, specifying maxrows in a
> fetchall_arrayref?
>
> If I use something like
>
> while ( my $array_ref=$sth->fetchall_arrayref(undef, $maxfetch)) {
> # ... do something
> }
See example from Tim's advanced DBI talk, last item.
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582
Australia Post is committed to providing our customers with excellent service. If we
can assist you in any way please either telephone 13 13 18 or visit our website
www.auspost.com.au.
CAUTION
This e-mail and any files transmitted with it are privileged and confidential
information intended for the use of the addressee. The confidentiality and/or
privilege in this e-mail is not waived, lost or destroyed if it has been transmitted
to you in error. If you have received this e-mail in error you must (a) not
disseminate, copy or take any action in reliance on it; (b) please notify Australia
Post immediately by return e-mail to the sender; and (c) please delete the original
e-mail.