I’m running DBI in Perl and can’t figure out how, when I run a prepared statement, I can figure out if the returned row count is 0.
I realize I can set a counter inside my while loop where I fetch my rows, but I was hoping there was a less ugly way to do it.
In order to find out how many rows are in a result set you have exactly two options:
select count(*)You can introduce some magic via a stored procedure that returns an array or something more fancy, but ultimately one of those two things will need to happen.
So, there is no fancypants way to get that result. You just have to count them 🙂