I inherited some perl code that mostly works, but which I've a couple
questions about what it is doing.

Skipping miscellaneous comments, etc. the code sets some variables
from a file, sets its oracle environment, and then does the following:
$oraProdDBH = DBI->connect("dbi:Oracle:", $user_name, $password)
    or die "Failed to connect to $DBI:errstr\n";
$oraProdDBH->{RaiseError} = 1;
$oraProdDBH->{AutoCommit} = 0;
 $oraProdDBH->{LongReadLen}=4000;
$getMatchRec = $oraProdDBH->prepare
(q{
    SELECT sec_person_id, unix_uid FROM csi_core
    WHERE sec_person_id != 0 GROUP BY unix_uid, sec_person_id
    HAVING COUNT(sec_person_id) > 1
});

$getMatchRec->execute()
    or die "Couldn't fetch records from CSI_CORE";

if ($oraProdDBH->rows != 0)
{

and proceeds to do some stuff.

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.

Is there a meaning for it?  From reading the docs, it seems as if
getting past that die statement should mean that the statement
actually executed (regardless of whether it returned any rows).

The code goes on to use $getMatchRec->fetchrow_array() to get
information and , after that loop finishes, uses $getMatchRec->rows to
determine whether any rows were fetched and processed.

I am just trying to understand what the $oraProdDBH->rows means (if
anything).

Reply via email to