Page 1062
You can embed OCI in a precompiled host program by following these steps:
The LDA data structures and function calls are language specific. Consult the Programmer's Guide to the Oracle Call Interface for complete information about this product.
The Oracle SQL*Module compiler (version 1.1 was released with Oracle7.2) provides access to ANSI standard module language files and Oracle stored PL/SQL procedures through native function calls in Ada, C, and C++. It is 100 percent compliant with entry-level SQL92. It accepts names of PL/SQL stored procedures and reads call interface declarations. SQL*Module can be mixed or matched with OCI or Pro*Ada and Pro*C/C++.
Programmer productivity is improved when you let SQL experts write database code and C experts write C code. SQL*Module works by converting the SQL modules into stored procedures, producing specification files that are included in 3GL source files. After you add the appropriate Oracle runtime libraries to the project build utility, the compile and link process works as usual. Security is enhanced by granting users EXECUTE privileges on the stored procedures, instead of giving direct access to data. Stored procedures also improve performance because you can compile them once and share them via the Oracle7 shared SQL cache.
Oracle precompilers provide an excellent tool for programmers to create dynamic applications. This chapter provided information on what a precompiler does, the benefits of embedding SQL statements in a 3GL host program, how to use a precompiler, and how to create a host program. It also introduced Oracle Call Interface and SQL*Module, two other products in the Programmer/2000 suite of productivity tools. Together with ODBC and Oracle Objects for OLE, the complete product suite making up Programmer/2000 provides application developers with complete access to Oracle databases without giving up any of the control found in 3GL languages.
Page 1063
Page 1064