Re: Pro*C include files

From: Tim Smith <tssmith_at_netcom.com>
Date: Tue, 13 Dec 1994 14:08:44 GMT
Message-ID: <tssmithD0r5yK.69I_at_netcom.com>


leng_at_cougar.vut.edu.au (Leng Kaing) writes:
>Pro*C 1.4.8.2.2 and Oracle 6.0.36.??
 

>I'm asking this for a friend... Currently, if he has the program in one
>file, everything compiles and run. But once he splits it up into
>two files, it doesn't even compile. File1 has the main() module. It
>has included file2 as such:
 

> #include <file2.pc>
 

>so the question is, can we include a .pc file in another .pc file? Or
>do we compile file2 first, and #include <file2.c> .
 

>The error seems to point at file2. Do we need to say EXEC SQL INCLUDE
>sqlca in file2 as well even though file1 already has the
>declaration? The possibilities are endless. So I was hoping to save
>time and post my confusion instead.

Pro*C prior to release 2.0 does not recognize #include, which is a C preprocessor directive that takes effect after precompilation. So you have to do

EXEC SQL INCLUDE file2.pc

to include a file that has embedded SQL in it (or host variables in a Declare Section). This way, Pro*C does the include, and the contents of file2.pc are precompiled.

This is spelled out quite clearly in Chapter 1 of the Pro*C Supplement to the Oracle Precompilers Guide.

For Pro*C release 2.x, the #include is recognized, since Pro*C has its own version of the C preprocessor.

--Tim (tssmith_at_oracle.com) Received on Tue Dec 13 1994 - 15:08:44 CET

Original text of this message