Pro*C - SQL_CURSOR variable/Dynamic SQL Method4 usage

From: Mukund <mukundk_at_my-deja.com>
Date: Thu, 04 Jan 2001 15:16:45 GMT
Message-ID: <93244j$c8c$1_at_nnrp1.deja.com>


[Quoted] I am trying to write a common Pro* C function that can open and setup a [Quoted] cursor given the cursor name and the select statement. I am thinking of [Quoted] passing the cursor name as a SQL_CURSOR variable and opening it inside the function. ORACLE documentation says that I cannot use EXEC SQL OPEN [Quoted] to open the cursor variable and has to be done inside a PL/SQL block or [Quoted] a stored procedure.

Since I have the sql statement as a character string (passed into this function), I tried to use ANSI dynamic SQL method 4 to prepare and execute
the statement. For opening the cursor I have two options: either EXEC SQL OPEN to open the cursor (where I cannot open the cursor variable) or I have to use the PL/SQL block (where I cannot use USING DESCRIPTOR for the input variables for the select statement). Is there any other way to do this with Pro* C or should I have to use OCI or can this be achieved by a combination of Pro *C, OCI and PL/SQL?

Will really appreciate any help.
Mukund

Sent via Deja.com
http://www.deja.com/ Received on Thu Jan 04 2001 - 16:16:45 CET

Original text of this message