Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> OCI Cursor Question
I have a program that calls a procedure in a package to return a cursor ref
to be used to fetch data. Can I safefy reuse the statement handle bound for
the cursor ref for other cursor refs? Here is the current flow:
Done once:
1) stmtHandle = OCIHandleAlloc()
2) cursorHandle = OCIHandleAlloc()
Done iteratively, for different packages/procedures execution statements: 3) OCIStmtPrepare( stmtHandle ) - always a stored procedure execution 4) OCIBindXX( stmtHandle ) - bind in/out variables for stored procedure, including cursorHandle
5) OCIStmtExecute( stmtHandle ) - execute the stored procedure 6) OCIDefineXX( cursorHandle ) - define output locations for fetch 7) OCIStmtFetch( cursorHandle ) - until all data retrieved 8) OCIStmtFetch( cursorHandle ) - with 0 rows (to cancel)
My questions:
- Is this flow okay, that is, is it safe or does it cause a potential leak?
Using OCI8.
Thanks in advance,
R
Received on Fri Aug 31 2001 - 03:35:35 CDT