Re: How do I use Oracle from a UNIX C++ program (Pro C, OCI, etc)?

From: Sundar Narasimhan <sundar_at_ne.mediaone.net>
Date: 2000/05/19
Message-ID: <3924BD7C.DDA918FB_at_ne.mediaone.net>#1/1


Personally I find both Pro-C/OCI too low level. Note that the author asked for C++ tools.
I've had good success with Roguewave's DBTools.h++. Check it out.

argosy22_at_my-deja.com wrote:
>
> Hi,
>
> You will find the learning curve very large with OCI,
> compared to ProC. IMHO, It's better to stick with ProC.
>
> Try to make a simple hello world program in ProC.
>
> EXEC SQL DECLARE VARIABLES (<- Not the correct syntax.)
>
> memvar declarations here.
>
> Connect to Oracle.
>
> EXEC SQL
> "SELECT 'HELLO WORLD'
> INTO :memvar
> FROM DUAL";
>
> printf (memvar);
>
> Disconnect from Oracle.
>
> You are correct. Oracle support is no help.
>
> The thing about the makefiles is that you have to know
> about 3 things:
> - Oracle, and ProC
> - C and the compilers
> - Unix
> Unless you have worked with it, you won't know it. This is
> not documented anywhere.
>
> You have to look at the syntax for Oracle Precompiler,
> and then the syntax for the C cc compiler. This is the
> secret that they don't tell.
>
> I will try to find my sample ProC programs over the weekend
> for you. In the meantime, find your documentation for ProC
> or at Technet.oracle.com, and read it before starting.
> It does have a learning curve, but less than OCI.
>
> If you search the archives at www.deja.com,
> you might find some sample ProC programs.
>
> The useful thing about ProC is the ease of reading and
> writing to a Unix file. You can write long formatted reports
> with it. And read from file.
>
> Good luck,
>
> Argosy
>
> In article <3908ad3a.84187304_at_news-east.newscene.com>,
> chambers_at_inquiregroup.com (Don) wrote:
> > I am writing a middle tier C++ program that will run on a UNIX system
> > (HP-UX) and needs to connect to Oralce. Has anyone had success with
> > this? What is the best way to do it?
> >
> > I have tried using Pro*C but it does not inetgrate well with our
> > development environemnt (SoftBench). There is also very little
> > documentation on it and Oracle tech support is no help with setup
> > problems. They just tell me to look at a sample make file.
> >
> > I am considering using the Orcle Call Interface (OCI) but have never
> > used it.
> >
> > I can't seem to find many books or any classes for Pro*C or OCI.
> >
> > Does anyone have any suggestions?
> >
> > I can use a third party tool if one is available but I would like to
> > be able to use SQL statements if possible.
> >
> > Thanks,
> > Don
> > chamber_at_mindspring.com
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri May 19 2000 - 00:00:00 CEST

Original text of this message