Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> How to cancel default cursor ?
Hi all,
with Oracle 8, I am encountering a strange problem with the management
of cursors.
My OCI program uses one session, prepares a large number of SELECT
statements, then executes several of them with OCIStmtExecute and
OCIStmtFetch. There is no problem when I execute a limited set of these
queries for an arbitrary number of executions within the same session.
However, it seems that Oracle assigns an individual cursor instance to
each prepared SELECT statement when it is executed, which seems to
persist even after all the data is received. That means, if I execute
some fifty different SELECT statements, I get an error "too many
cursors", because that is the current resource limit.
My question now is, how do I cancel the default cursor for a statement after I have received all my data ? There seem to be no cursor management functions in OCI. I tried to do a dummy fetch with a rowcount of zero, but that didn't solve the problem. Furthermore, the comments in the OCI header files indicate a mode value OCI_EOF_FETCH for OCIStmtFetch, but there is no such constant available, and it is also not documented.
Of course, I could increment the resource limit for cursors, but that may not be the ideal solution, and I rather would like to have a closer control on the allocated resources within my program.
Does anyone have any hints on this problem ?
thanx in advance,
Michael Received on Wed Oct 13 1999 - 16:14:28 CDT