The stupid question is the question not asked | |
PerlMonks |
DBI::fetchall_arrayref() errorby blokhead (Monsignor) |
on Jan 11, 2004 at 22:47 UTC ( [id://320547]=perlquestion: print w/replies, xml ) | Need Help?? |
blokhead has asked for the wisdom of the Perl Monks concerning the following question:
I'm having trouble with fetchall_arrayref() giving a very nonsensical (to me) error. Here's a little test that demonstrates it. (I know fetching results 3 rows at a time is silly, but it's only a test.)
OK. This code runs fine (for me)! But if I change undef to [0] in the fetchall_arrayref() line, I get this output: What gives? The execute() is fine, and certainly is before the fetchall_arrayref() call. But some people even seem to get these errors with the undef in there! FWIW, I'm using DBI 1.38. Since my query only returns one column, I should be able to use [0] as the first argument to fetchall_arrayref() to explicitly just fetch the one column. Right? It's not a huge problem for me to fetch rows one at a time and avoid fetchall_*, but it would be kinda nice to use fetchall_*, as it seems to be the fastest way to get lots of a data. Additional: It's not the infinite loop that bothers me so much -- that can be worked around. It's that with the [0] argument, the fetchall_arrayref() doesn't work at all and I can't get the query's results. blokhead
Back to
Seekers of Perl Wisdom
|
|