Re: [Q] Compatibility of Oracle Pro*C and C++

From: Marek Pytlik <pytlik_at_eris.cs.umb.edu>
Date: 1 Oct 1993 19:34:51 GMT
Message-ID: <28i0or$i1v_at_cs.umb.edu>


In article <MLOENNRO.93Oct1010026_at_wrpyr4.us.oracle.com> mloennro_at_us.oracle.com (Magnus Lonnroth) writes:
>In article <1993Sep30.191612.6775_at_nynexst.com> dmj_at_seneca.nynexst.com (David Johnson) writes:
>
>[stuff deleted]
>
> I figure that I would have to use the precompilers to help me build a
> C library of functions that to talk to the database. I'd then have
> to call these functions from my C++ program. Is it that difficult?
> Or, is it impossible!? I won't have the configuration to give it
> a try for a couple of weeks...
>
>At the moment, there is no way of including embedded SQL in C++ modules.
How about this:

cBroadcast::open( int id)
{

   // our macro
    EXEC SQL DECLARE CB1 CURSOR FOR
    ...
    WHERE ID=...
    ;
    EXEC SQL OPEN CB1;
   return 0;
fail:

        return 1;
}

Similary you can do cBroadcast::fetch, and others.

>To use Pro*C v1 (and v2 soon to be released) you must write extern C

All you have to do (oracle unsupported), is to have something like:

extern "C" {
extern void sqlbcc( int*, int* );
...
}

>mus ne hard-coded and are precompiled into globals, making it difficult
>to write "generic" functions.
>
>A better choice for C++ is Oracle Glue or OCI. Both of these are APIs
>and may be called directly from member-functions etc. Please contact
>your local Oracle office for details. If you're experienced with Pro*C,
>you'll probably prefer Oracle Glue, since the syntax is more or less the
>same.
>
>cheers,
>
>Magnus Lonnroth
>Oracle Sweden
>
>[My opinions are not supported]

Mark Pytlik Received on Fri Oct 01 1993 - 20:34:51 CET

Original text of this message