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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to stop an OCI query?

Re: How to stop an OCI query?

From: Ramon F Herrera <ramon_at_conexus.net>
Date: 12 Aug 2003 18:34:35 -0700
Message-ID: <c9bc36ff.0308121734.2069f772@posting.google.com>


You are right, Xho. Unfortunately, I still have the same problem. I made a cut&paste mistake when I posted my code. In reality, I don't have two OCIStmtFetch2's, there is only one:

while ((result = OCIStmtFetch2(select, errhp, 1, OCI_FETCH_NEXT, 0,

        OCI_DEFAULT)) == OCI_SUCCESS) {
        // retrieve record
        }

The loop above terminates before the all the data is fetched.

-Ramon

ctcgag_at_hotmail.com wrote in message news:<20030812121236.833$Os_at_newsreader.com>...
> ramon_at_conexus.net (Ramon F Herrera) wrote:
> > What's the correct condition to check in order to stop
> > a running OCI query? I have tried several approaches
> > (see below) but I can't seem to find the right one.
> >
> > The following gives me too few records:
>
> Let me guess, it gives about half the number of records it should?
>
> > while ((result = OCIStmtFetch2(select, errhp, 1, OCI_FETCH_NEXT, 0,
> > OCI_DEFAULT)) == OCI_SUCCESS) {
> > OCIStmtFetch2(select, errhp, 1, OCI_FETCH_NEXT, 0, OCI_DEFAULT);
> > // retrieve record
> > }
>
> You fetch a record. If it succeeds, you ignore that record and fetch
> another one (and don't check to see if the second fetch succeeds.)
>
> Xho
Received on Tue Aug 12 2003 - 20:34:35 CDT

Original text of this message

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