in reply to Re^2: Counting number of rows while working with Oracle
in thread Counting number of rows while working with Oracle
Oh, I missed that bit about returning at most one row! He can simply use
my $row = $dbh->selectrow_arrayref($stmt_or_sth);
or
my $row = $sth->fetch_arrayref(); $sth->finish();
defined($row) will tell him if a row was returned. If the row only contains one field and it can't be NULL, then he could even use
my ($value) = $sth->fetch_array(); $sth->finish();
defined($value) will tell him if a value was returned (again, assuming the value can't be NULL).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Counting number of rows while working with Oracle
by denzil_cactus (Sexton) on Mar 18, 2008 at 12:12 UTC | |
by andreas1234567 (Vicar) on Mar 18, 2008 at 12:24 UTC | |
by denzil_cactus (Sexton) on Mar 20, 2008 at 07:12 UTC | |
Re^4: Counting number of rows while working with Oracle
by denzil_cactus (Sexton) on Mar 18, 2008 at 11:02 UTC | |
by ikegami (Patriarch) on Mar 18, 2008 at 12:52 UTC | |
by andreas1234567 (Vicar) on Mar 18, 2008 at 11:42 UTC | |
by denzil_cactus (Sexton) on Mar 20, 2008 at 08:44 UTC |