$DBI::rows with SELECT

From: claude <blanchet_at_akio-solutions.com>
Date: Thu, 11 Jan 2001 12:18:37 +0100
Message-ID: <3A5D968D.3234D825_at_akio-solutions.com>


Hi,
Configuration : Linux & Oracle 8i & Perl.

We have a problem with $DBI::rows.
The book "Programming the Perl DBI" collection O'Reilly page 226 says :

"$rv = $sth->rows;

Returns the number of rows affected by the last row-affecting command, or -1 if
the number of rows is not known or not available. ...
... use of the rows method or $DBI::rows with SELECT statements is not recommended.
One alternative method to get a row count for a "SELECT is to execute a
"SELECT COUNT(*) FROM..." SQL statement
with ..."

But the problem is that, with this solution, we need to know the name of the last table where we had a SELECT.

Is existing an other solutions ?

Thank you.
Claude & Prhasak Received on Thu Jan 11 2001 - 12:18:37 CET

Original text of this message