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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PRO*C Minimums

Re: PRO*C Minimums

From: Steve Phelan <stevep_at_no-spam.pmcgettigan.demon.co.uk>
Date: 1997/05/13
Message-ID: <33781850.31C834E@no-spam.pmcgettigan.demon.co.uk>#1/1

Robert the Great wrote:

> Hello all,
> I am currently in the process of learning C and am not sure
> how to
> incorporate Oracle queries into my applications.
> I have Oracle 7.2.3 on a HP-UX machine, and for instance: What
> is
> the basic minimums that I need to get an Oracle Proc*C script to
> precompile and compile successfully? If all I wanted to to do the
> following script, what is it that I am missing?
>
> int main(void){
> int number;
> exec sql select acctnum into :number from main;
> printf("%d",number);
> return 0;}
>
> Thanks in advance!
> Rob G.

 Well, you're going to have to declare a SQL Communications area (SQLCA) and add a declarations section for your 'host' variables (the ones which will receive data from Oracle). You can compile and link the program with the 'make' file that is installed with Pro*C. You might also want to look at the simple example programs that are also installed with Pro*C - build them and run them to get an idea how all of this works...

To be honest, you really need to know a lot more about this than just the syntax. Get yourself a copy of the Oracle Pro*C manuals, either online or paper based, and make sure you fully understand the C language before you delve into the more complex Pro*C areas, like dynamic sql method 4, for instance.

Steve Phelan. Received on Tue May 13 1997 - 00:00:00 CDT

Original text of this message

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