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 -> OCI Cursor Question

OCI Cursor Question

From: Rick Robinson <rick_at_oyarsa.com>
Date: Fri, 31 Aug 2001 08:35:35 GMT
Message-ID: <r%Hj7.37520$Iq4.18232648@typhoon.columbus.rr.com>


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

Original text of this message

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