Home » Developer & Programmer » Precompilers, OCI & OCCI » Pro*c Include File
Pro*c Include File [message #94230] Thu, 27 May 2004 22:38 Go to next message
Kaustubh Deshpande
Messages: 32
Registered: March 2004
In c , general practice is , we create header file (.h)which will have declaration of functions. One more file which will have actual body of those functions.
And in main file we include that header file, we never include the file in which actual body is written. As we will not give our client code of those functions.

The same thing , I am trying to do in pro*c, but couldn't succeed, Linking Error comes and exe is not generated.

Could any one tell me the way to do it ?

Re: Pro*c Include File [message #94275 is a reply to message #94230] Mon, 28 June 2004 21:17 Go to previous message
Jai Vrat Singh
Messages: 205
Registered: September 2002
Location: Singapore
Senior Member
if you header file as myheader.h

and you main program ( or .pc file) is process.pc ( say .)

then inside process.pc use

EXEC SQL INCLUDE myheader.h;

instead of

#include "myheader.h"

Then precompiler wil take care of that to include its contents before anything.
You get error because C preprocessor does its job after the oracle precompiler.

Hence above substitution will work.

Jai Vrat
Previous Topic: SQL select and C
Next Topic: OCIStmtFetch error handling
Goto Forum:

Current Time: Thu Sep 20 03:28:36 CDT 2018