With DBI
is there a way to determine if an executed statement handle for a SELECT statement will return any rows without fetching from it?
I.e. something like:
use DBI;
...
my $sth = $dbh->prepare("SELECT ...");
$sth->execute;
if (..$sth will return at least one row...) {
...
} else {
...
}
and I want to perform the test $sth will return at least one row
without performing any fetch method on $sth
.
Note - I don't need the exact count of rows (i.e. $sth->rows
), I just need to know if $sth->rows
will be > 0.