We have an application that prepares several statements and then tries to
repeatedly execute them. The basic sequence is:
OCIStmtPrepare()
....
do {
OCIStmtExecute() ...
OCIStmtFetch() ...
}while (there_are_results);
My question is I keep getting "maximum open cursors exceeded" error and I
don't know how to close the result set. The documentation says to call
OCIStmtFetch() with 0 rows to "cancel the cursor" but this seems to have no
effect.
I don't want to free the statement because then I have to prepare it again,
and we were trying to prepare once and just re-execute the same statement as
needed (or is this type of optimization not possible or handled differently
on Oracle?). This works on all the other databases we support (Informix,
Sybase, MS-SQL) but we have run into a brick wall on Oracle and I can't seem
to find anything in the documentation.
Any help is greatly appreciated.
Thanks
Joe