Dynamic SQL & Variable Cursor Names

From: Allan Krause <allankr_at_optushome.com.au>
Date: Thu, 24 May 2001 14:51:41 GMT
Message-ID: <3b0d1e00.14038215_at_news.rochd1.qld.optushome.com.au>


I'd really appreciate some help with this...

I'm trying to write an embedded-sql C routine (to be compiled with Pro*C) which will support multiple concurrent cursors. I am passing sql statements (inserts) to this routine to be prepared and for individual cursors to be declared. Henceforth, I will pass the routine a flag indicating which statement I want to execute, together with the bind variable values to be loaded into the distinct sqlda structures the routine will be maintaining.

This routine has been based on the sample program provided by Oracle to demonstrate the implementation of Dynamic SQL Method 4.

The statement "EXEC SQL OPEN C USING DESCRIPTOR bind_dp;" has a hardcoded cursor name, "C". I need to be able to supply distinct names (according to the different sql statements I am passing).

Has anyone tell me how the cursor name can be made variable and how such a variable must be defined in C??

Many thanks

Allan Krause
allan_krause_at_technologyonecorp.com Received on Thu May 24 2001 - 16:51:41 CEST

Original text of this message