Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Oracle 8i OCI (newbie) Q: no. rows returned in a SELECT?

Oracle 8i OCI (newbie) Q: no. rows returned in a SELECT?

From: John Garner <jgarner_at_commercenti.com>
Date: Mon, 06 Aug 2001 12:52:34 +0100
Message-ID: <3B6E8502.8D1FCED@commercenti.com>

Hi,

I'm a good C++ programmer, but new to Oracle and for the life of me cannot find out how many rows a select query has returned via the OCI and any of the attributes. Not without fetching all the rows first anyway, which I don't want to have to cache in memory as there may be a lot of them.

I've tried OCIAttrGet() on the statement handle once it's OCIStmtExec()'d with both OCI_ATTR_ROW_COUNT and OCI_ATTR_PARAM_COUNT, but both of them appear to set it to 0(zero) - possibly the number of rows fetched so far (done straight after the query).

I can fetch the number of columns fine using OCIAttrGet and OCI_ATTR_PARAM_COUNT, my OCI call for number of rows looks the same apart from the different attribute I want.

Help! Can you find out how many rows a query returns without getting them all????

John G. Received on Mon Aug 06 2001 - 06:52:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US