Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: How do I use Oracle from a UNIX C++ program (Pro C, OCI, etc)?

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

From: <argosy22_at_my-deja.com>
Date: 2000/04/28
Message-ID: <8ecmss$gcl$1@nnrp1.deja.com>#1/1

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 Apr 28 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US