in reply to Determining if a DBI SELECT comes back empty
Note that the finish() is required here because you do no fetching. If one of the if's had a fetch, you'd omit the finish().if (my $rows = $sth->execute) { if ($rows==0) { print "Zero rows returned"; } else { print "$rows rows returned"; } } else { print "Failed execute: ". $sth->errstr; } $sth->finish;
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Determining if a DBI SELECT comes back empty
by tantarbobus (Hermit) on Dec 05, 2003 at 22:43 UTC |