hanaclient_num_rows Function
Returns the number of rows in the result set.
Parameters
- $stmt
-
A statement object executed by hanaclient_execute or hanaclient_execute_direct.
Returns
Returns a scalar value that is the number of rows in the result set. If the number is an estimate, then it is negative and the estimate is the absolute value of the returned integer. The value returned is positive if the number of rows is exact.
Remarks
By default, this function only returns an estimate. To return an exact count, set the ROW_COUNTS option on the connection.
The number of rows in a result set can be returned only for the first result set in a statement that returns multiple result sets. If hanaclient_get_next_result moves to the next result set, then hanaclient_num_rows still returns the number of rows in the first result set.
Example
stmt = api.hanaclient_execute_direct( conn, "SELECT * FROM "Products"" ) # Get number of rows in result set num_rows = api.hanaclient_num_rows( stmt )