What is Pro*C ?
How to compile Pro*C program ?
- Oracle software provides the, PROC compiler (Oracle Precompiler), and this compiler takes the C program having embedded SQL statements.
What is Oracle precompiler ?
- An oracle precompiler may be a programming tool that permits the user to embed the SQL statements during a high-level program . This compiler takes the program as input, replacing the embedded SQL statements with the oracle runtime library calls, and this modified program can now compile, link, and execute.
- The whole process of compilation of Pro*C program is given below:
Process of Compilation
- First, we create a C program , which contains the SQL statements, then we save this file with an extension '.PC'. Here, '.PC' means the program may be a Pro*C program.
- After creating a program, we compile the program by using the PROC compiler, which is provided by the Oracle. The PROC compiler generates .c file with all the SQL statements replaced by the functions which are already pre-defined within the Oracle runtime library.
- The file created by the PROC compiler are going to be compiled again by the C compiler , which is supported by Pro*C. In Windows, the PROC compiler supports Microsoft Visual C++ compiler.
- The C compiler will create a .exe file.
- Now, finally, we run the .exe file.
Why do we need the Pro C compiler?
- The Pro c compiler allows you to embed the SQL statements With in the C program and it also provides the specified interface unlike many other development tools. The Pro C allows you to customize applications.
- It creates user interfaces that incorporate the newest windowing and mouse technology.
- Sometimes its possible that we cannot generate the reports from other development tools. But we will achieve this by retrieving the info from the oracle database.
- The main requirement of Pro C is to put in the Pro C software. Once we are installing the oracle database then we’ve to form sure that we’ve selected the Pro C components.
- If we’ve to see whether the installation of oracle contains the Pro C components is by checking the PRECOMP directory of Oracle.
- When we install the oracle .a directory structure is made on our disk drive for the oracle products.
- The most oracle directory will contain the subdirectories and files which are required for the Pro C.
- When we install the Pro C in Oracle. Then Oracle Universal installer creates a Directory referred to as precomp within the ORACLE BASE /ORACLE HOME directory. This subdirectory(i.e. precomp) contains the executable files, library files.
Sample Programs Given Below
|\admin||It contains the configuration files.|
|\demo\proc||It contains the sample programs for Pro*C.|
|\demo\sql||It contains sql scripts for sample programs.|
|\doc\proc||It contains the documentation files for pro*c.|
|\help\proc||It contains help files for Pro*C.|
|\lib\msvc||It contains library files for Pro*C|
|\mesg||It contains message files.|
|\misc\proc||It contains miscellaneous files for Pro*C.|
|\public||It contains the header files having .h extension.|