Precompiler
A precompiler is a tool that allows programmers to embed SQL statements in high-level source programs like C, C++, COBOL, etc. The precompiler accepts the source program as input, translates the embedded SQL statements into standard Oracle runtime library calls, and generates a modified source program that one can compile, link, and execute in the usual way.
History
Starting with Oracle 8, precompiler versions were synchronized with the database version. Earlier version had unique version numbers. For example:
- Oracle 7.0 shipped with Pro*C version 1.5
- Oracle 7.1 shipped with Pro*C 1.6 and 2.0
- Oracle 7.2 shipped with Pro*C 1.7 and 2.1
- Oracle 7.3 shipped with Pro*C 2.2
- Oracle 8.x shipped with Pro*C 8.x
Because Pro*C 2.x behaved so differently from Pro*C 1.x, and to ease migration, both versions of Pro*C shipped with Oracle 7.1 and 7.2. Options like PARSE=PARTIAL and PARSE=NONE were available to simulate version 1.x behaviour.
Difference between OCI and the Precompilers
Oracle OCI (Oracle Call Interface) provides an alternate lower-level interface to the Oracle database.
The SQL precompilers for the various host languages (Pro*C, Pro*Ada, Pro*Fortran, Pro*COBOL, etc.) reads EXEC SQL commands and generate data structures and calls to its runtime library: SQLLIB (libsql.a in UNIX). SQLLIB, in turn, calls the User Program Interface (UPI) to communicate with the database. It does not generate calls to the Oracle Call Interface (OCI) but one can mix OCI and Precompiler calls.
Provided precompilers
The following 3GL languages are supported by the Oracle precompilers:
- Pro*C
- Pro*Cobol
- Pro*Fortran
- SQLJ
- Etc.
Please note that Oracle 8 and above doesn't support Pascal, PL/I and Ada anymore.
Licensing
From the Oracle database 10gR2 licensing guide: "Oracle Programmer is a separate Oracle product that provides a programmatic interface to any edition of Oracle Database for application programmers. Programmer provides a rich set of interfaces for developers who build enterprise applications that access and manipulate Oracle Database. This product is licensed separately from the Oracle Database products. Oracle Programmer is a family of the following products:
- Three embedded SQL-style interfaces: precompilers, SQL*Module, and SQLJ
- Two utilities to generate host-language bindings from database schemas: ObjectType Translator and JPub"
Though very little emphasized, this sounds like writing, compiling and/or running any Oracle Programmer supported technology, including the precompilers, (may) require an additional licensed product (additional to the database license.) The product is available in the Oracle Store, with a "Named User Plus" licensing metric (not clear whether this counts developers or users), priced at about 125% of the Oracle Database Enterprise Edition Named User Plus cost. This suggests that only developers need to be counted, just like in the Oracle (Internet) Developer product.