Re: Pro*C and C++

From: Magnus Lonnroth <mloennro_at_se.oracle.com>
Date: Fri, 22 Apr 1994 07:38:46 GMT
Message-ID: <MLOENNRO.94Apr22093846_at_ramses.se.oracle.com>


In article <2p3236$m4l_at_ciup2.ncc.up.pt> dpaes_at_obelix.fe.up.pt (Dinis Manuel Alves da Mota Paes) writes:

>
> Hello,
>
> We're developing our project in C using Pro*C for the database interface,
> but are now considering writing the next version in C++.
> Is it possible to mix C++ and Pro*C? And if it's possible, is it safe?
>

The C-code generated by Pro*C is not suitable for inclusion in C++ methods, because cursors are hard-coded and have a different scope (they're compiled-unit (=file) globals). You can work around this by using messy code like :

switch ( c )
{

	case 1:
	exec sql open c1;
	break;

	case 2:
	exec sql open c2;
	break;

	.
	.
	.

}

However, you should consider an API, which allows dynamic cursor handling, such as Oracle*Glue (available on Windows and imminent on Mac) or OCI, which is our own (non-standard) C call-interface available on all platforms.

It does depend on what you're doing though. It is fully "possible" to use Pro*C.

hope this helps...

--

Magnus Lonnroth
Tech.Sales & Consultant
Oracle Sweden
Mail: mloennro_at_se.oracle.com
Received on Fri Apr 22 1994 - 09:38:46 CEST

Original text of this message