The reason the code doesn't go into the while loop is because the result set is empty! Some drivers may give you some meta data on the number of records returned (or you could use fetchall_hashref or fetchall_arrayref) or you could just use a sentinel:
$sth->execute() || die $sth->errstr; my $flag = 0; while ($pointer = $sth->fetchrow_hashref) { $flag++; ... } if( ! $flag ) { print "No records for ...." }
In reply to Re: Perl and SQL issue.
by derby
in thread Perl and SQL issue.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |