in reply to small cgi output problem
Using DBD::Oracle, I consistently get $sth->rows returning 0 even when there's data for it. The reason that is, consulting the documentation, is that rows reliably returns the number of rows affected by a statement that *modifies* data, not on SELECT ones:
For `SELECT' statements, it is generally not possible to know how many rows will be returned except by fetching them all. Some drivers will return the number of rows the application has fetched so far, but others may return -1 until all rows have been fetched. So use of the `rows' method or `$DBI::rows' with `SELECT' statements is not recommended.You'll just have to count 'em manually, looks like.
HTH
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: small cgi output problem
by suaveant (Parson) on Apr 09, 2001 at 20:56 UTC | |
by chromatic (Archbishop) on Apr 09, 2001 at 21:00 UTC | |
by Anonymous Monk on Apr 09, 2001 at 21:11 UTC | |
by arturo (Vicar) on Apr 09, 2001 at 21:42 UTC | |
by suaveant (Parson) on Apr 09, 2001 at 21:13 UTC |