How do I get count of rows from Oracle SELECT

163 Views Asked by At

I can't find proper way to get count of rows returned after successful execution of SELECT statement via ODPI-C.

Hope you can help me.

EDITED: There is a function

int dpiStmt_getRowCount(dpiStmt *stmt, uint64_t *count)

but it only returns the number of rows affected by the last DML statement that was executed or the number of rows currently fetched from a query.

1

There are 1 best solutions below

1
Christopher Jones On BEST ANSWER

This is not ODPI-C specific. Oracle Database doesn't provide this automatically on SELECT statements. You have to fetch the rows and then count them. Or run 'SELECT COUNT'.