Easysoft Data Access

Why does SQLRowCount/odbc_num_rows and $sth->rows return -1?

Last Reviewed:
4th July 2017

odbc_num_rows is the PHP wrapper for the ODBC API SQLRowCount. $sth->rows is the Perl DBI method of obtaining the results from the ODBC API SQLRowCount.

Most ODBC drivers only return a meaningful number from SQLRowCount when you execute row changing SQL e.g. updates, deletes, inserts. For selects most ODBC drivers return -1.

Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)

Oracle is a registered trademark of Oracle Corporation and/or its affiliates.