develooper Front page | perl.dbi.users | Postings from December 2008

Re: What is the meaning of the "rows" value after a select?

Thread Previous | Thread Next
From:
Douglas Wilson
Date:
December 1, 2008 17:52
Subject:
Re: What is the meaning of the "rows" value after a select?
On Mon, Dec 1, 2008 at 7:54 AM, Larry W. Virden <lvirden@gmail.com> wrote:
>
> if ($oraProdDBH->rows != 0)
> {

>
> What does that rows member of the oraProdDBH handle represent? When I
> print it out, it doesn't appear to be the number of rows selected. In
> fact, right now, it has a value of -1.
>

Some drivers do return the number of rows selected, but most don't
know how many rows are selected until after they are fetched.
It is the number of rows affected for an update/insert/delete statement,
but that's obviously not the case here. It seems like an attempt to
do something if there are any rows, but it looks like a bug.

Also, since RaiseError is set, the "or die..." part of this will never get
executed either:
$getMatchRec->execute()
   or die "Couldn't fetch records from CSI_CORE";

So I'd call that a bug of sorts also.

-Douglas Wilson

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About