in reply to DBD::Sybase $sth->rows returns -1
Would it be possible to use sth->rows or any other method to find the number of rows for select queries? I see that one option is to run each query twice, once the normal query needed and second time by using SELECT COUNT(*) FROM .... by keeping part after "FROM" same and then using $sth->rows on it. I am trying to find the better option.
I tried to call sth->rows after fetching all the rows, i.e. after
but it still returns -1.while (my @row_18 = $sth18->fetchrow_array) { $role = $row_18[0]; }
How can I call sth->rows after fetching all the rows?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBD::Sybase $sth->rows returns -1
by poj (Abbot) on Jan 06, 2016 at 18:30 UTC | |
by Perl300 (Friar) on Jan 06, 2016 at 22:08 UTC | |
by poj (Abbot) on Jan 07, 2016 at 14:07 UTC | |
by hotchiwawa (Scribe) on Jan 07, 2016 at 09:15 UTC |