in reply to How to fetch the size of the resultset from a DBI query?
in sql:
"SELECT COUNT(*) FROM people"doing the same in perl would be horribly inefficient, unless you're going to do something else with the results afterwards. here's a minimal version anyway, in case for some reason select count isn't possible:
my $records = $dbh->selectcol_arrayref('SELECT location FROM people'); my $peoplecount = scalar(@$records);
update: curses... redundant again.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to fetch the size of the resultset from a DBI query?
by seesik (Initiate) on Sep 12, 2001 at 23:37 UTC |