Re: Why is OCI discouraged and where can I find some simple demo programs?

From: sybrandb <sybrandb_at_gmail.com>
Date: 24 May 2007 05:09:52 -0700
Message-ID: <1180008592.746449.263730_at_o5g2000hsb.googlegroups.com>


On May 24, 1:53 pm, "Charles T. Smith" <cts.priv..._at_yahoo.com> wrote:
> I need to add an Oracle database to a C program. It's great that Oracle
> makes 10g available for free. But I've spent hours looking for
> information and tutorials for a C API and it's unproportionally difficult
> compared to similar products (e.g. solaris) for find anything.
>
> In fact, I finally identified OCI and some simple demo programs - like
> cdemo81.c (fromhttp://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci...)
> ... but it's in the 8.1 release. In my 10g release, I only find demos for
> special facilities. There is no access to the files from that web site.
> Also not on the Oracle web site. Also not on the net.
>
> So, it looks like there was reasonable documentation, and it has been
> removed from the distribution.
>
> What does Oracle have against C?

Oracle doesn't have anything against C.
Originally there was (and probably still is) pro*C and OCI. Pro*C is a so-called Host Language Interface, which takes away from you the chores of setting up a cursor.
If you compare OCI to Pro*C, OCI is only the raw materials, where Pro*C provides building blocks.
There are Pro*C demos in 9i (look for files ending in .pcc in proc directories), I don't think Oracle has obsoleted Pro*C. There also is a C++ interface, called OCCI, which is discussed at http://www.oracle.com/technology/sample_code/tech/occi/index.html

I admit this is hard to find, but it is there!

Hth

--
Sybrand Bakker
Senior Oracle DBA
Received on Thu May 24 2007 - 14:09:52 CEST

Original text of this message