essej1 has asked for the wisdom of the Perl Monks concerning the following question:
I'm using the DBI fetchall_arrayref to get the rows from an Oracle SQL statement. (I'm using this one as I do not expect many hits.) There are valid conditions when now rows are found.
If I putmy $result_array = $sth->fetchall_arrayref; foreach my $row (@{$result_array}) { print join (",", @$row),"\n"; print FH join (",", @$row),"\n"; }
after the fetchall I get "==><==" which indicates an empty string. Testing for this with the following doesn’t seem to work.print "==>@{$result_array}<==\n";
How do I test for the "nothing here" condition.if (@{$result_array} eq “”) { <some message> } else { <do the output> }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: no rows returned for dbi fetchall_arrayref
by toolic (Bishop) on May 07, 2013 at 16:30 UTC | |
by essej1 (Novice) on May 07, 2013 at 17:07 UTC | |
Re: no rows returned for dbi fetchall_arrayref
by Random_Walk (Prior) on May 07, 2013 at 16:37 UTC | |
Re: no rows returned for dbi fetchall_arrayref
by ruzam (Curate) on May 08, 2013 at 04:08 UTC |