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
 }

I get an inactive handle and an error on the last time through the loop.
Currently I am using:

while ( my $array_ref=$sth->fetchall_arrayref(undef, $maxfetch)) {
  # ... do something
  last if scalar(@$array_ref) < $maxfetch;
 }

But I figure there must be a neater way (maybe  $sth->Active?)  Couldn't see
anything in the fine POD - any ideas?

[BTW: Using this method, I get back 100,000 rows a time from a very large
Oracle table, at 6 seconds a fetch - that's quick!]

Michael Fox

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.

Reply via email to