Re: Pro*C

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sat, 06 Feb 1999 14:42:18 GMT
Message-ID: <36c65458.5175972_at_192.86.155.100>


A copy of this was sent to "Abe Jacob" <abrahamj_at_planmatics.com> (if that email address didn't require changing) On Thu, 4 Feb 1999 17:37:58 -0500, you wrote:

>Would anybody be able to tell me how I can do the following using dynamic
>SQL in PRO*C:
>
>I have approx. 600 tables in my database, my program does inserts and
>selects on any of these tables depending on the table name and some other
>data passed to it. I follow the steps in the sample10.pc. I want to keep
>the cursors open so that I do not have to re-declare and close it for speed.
>The only way it seems I can do this by using some sort of a "if else" or
>"switch case" statement which will be a huge one (with 600 tables).
>
>In INFORMIX ESQL/C I could declare a Host variable which could be used as a
>cursor so I used to copy the table name into this host variable and then do
>the steps in sample10.pc.
>
>Is their any way I can achieve what I want to do above?
>

currently, you would have to use OCI to do this. OCI treats cursors as variables. In pro*c, cursors are statically named at precompile time. In oci you could have an array of cursors -- in pro*c you cannot.

this changes in 8.1 for pro*c but right now, no, you would have to use oci.

>Thanks for the help.
>
>Abe
>
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/    -- downloadable utilities
 
----------------------------------------------------------------------------
Opinions are mine and do not necessarily reflect those of Oracle Corporation
 
Anti-Anti Spam Msg: if you want an answer emailed to you, 
you have to make it easy to get email to you.  Any bounced
email will be treated the same way i treat SPAM-- I delete it.
Received on Sat Feb 06 1999 - 15:42:18 CET

Original text of this message