FYI, For some drivers, "rows" may not return the correct value even after all the rows have been fetched. If I may quote Michael Peppler with regards to Sybase in an email he sent me. This is in regard to the "rows" method after a call to fetchall_arrayref... Relying on $sth->rows() is a little iffy. In the case of DBD::Sybase it returns -1 (that may be a bug, I'll look into it). You should probably simply use the number of elements in the [returned arrays] to determine the number of rows returned. -----Original Message----- From: jdw@ou.edu [mailto:jdw@ou.edu] Sent: Monday, January 31, 2005 4:21 PM To: Juan Jose Natera Cc: DBI Users Subject: Re: parameter binding issues with DBD::Oracle Juan, The problem is your usage of "$sth->rows". You aren't guaranteed to know how many rows are available before you read them, so your example doesn't really show whether data was available or not. Here is a snip from "perldoc DBI": ... 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 with select statements is not recommended. Juan Jose Natera wrote:Thread Previous | Thread Next