*Aaron Stone wrote:
likely that libdbi is adding this functionality. More likely, it's just
faking it somehow by retrieving all of the rows, counting them, and
caching them with the hope that they'll be requested later on anyways.
A numrows() solution will be the quick way to a first version, but we may
discover that the performance is terrible and 'SELECT COUNT(*)' is needed.
I guess we can cross that bridge if/when we get to it, though!
I saw that both, the libdbi-drivers for 'firebird' and 'oracle', not
supports the numrow(). For this reason I decided to port the
lib-dbidriver (firebird)to dbmail-interface. I'm in progress to
provide all db_xxx function with aint param 'stmt'. The advantage is,
that we can initalize more resultsets, not have to allocate memory and
not have to query count(*) statements.
/*db_fetch_row returns 0 if there is a record or -1 if there isn't*/
db_function_x(int param1, int param2, int stmt) {
...
if (db_query(sql,stmt) == -1) {
/*error*/
}
while ((row = db_fetch_row(stmt)) == 0) {
db_functiony(paramX, paramY, stmt+1);
}
db_free_result(stmt);
}
I hope this will solve our problem.
Dominik Fässler