Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Sqlite DBI $sth->rowsby digger (Friar) |
on Oct 22, 2003 at 15:53 UTC ( [id://301256]=note: print w/replies, xml ) | Need Help?? |
Super Search to the rescue - again. I had trouble with this issue, and found a decent thread here SELECT COUNT and DBI: rows that hashed out the issue pretty well with many experienced monks chiming in. It looks like the most portable way of doing this is to SELECT COUNT.... before doing the actual SELECT. You can also wrap your $sth->fetchrows in a while statement, which is ok if you just want to do nothing when no results are returned. It won't allow you to proactively deal with a situation where 0 records are returned, ie let a user know that their query returned no results. hth, digger
In Section
Seekers of Perl Wisdom
|
|