|Pro*C/C++ Precompiler Programmer's Guide
Part Number A76942-01
This appendix lists the new features offered in the Pro*C/C++ Precompiler, release 8. Each new feature is described briefly, and a reference to the more complete description in the chapters is provided.
Pro*C/C++ supports the use of arrays of structs which enable you to perform multi-row, multi-column operations. With this enhancement, Pro*C/C++ can handle simple arrays of structs of scalars as bind variables in embedded SQL statements for easier processing of user data. This makes programming more intuitive, and allows users greater flexibility in organizing their data.
In addition to supporting arrays of structs as bind variables, Pro*C/C++ now also supports arrays of indicator structs when used in conjunction with an array of structs declaration. See "Arrays of Structs".
The precompiler option HEADER specifies that precompiled header files are to be created and used to reduce the time and computer resources needed for developing large projects. See "Precompiled Header Files".
The CALL embedded SQL statement invokes a stored procedure. It can be used instead of an embedded PL/SQL block in new applications. See "CALL (Executable Embedded SQL)".
Pro*C/C++ provides client applications with a convenient way to change a user password at runtime through a simple extension to the EXEC SQL CONNECT statement. See "Using the ALTER AUTHORIZATION Clause to Change Passwords".
Pro*C/C++ supports multi-byte character sets (for NCHAR, NVARCHAR2, NCLOB columns) with database support, when NLS_LOCAL=NO. When NLS_LOCAL=NO, and the new environmental variable NLS_NCHAR is set to a valid fixed-width National Character Set, the Oracle8i database server supports NCHAR. See "Environment Variable NLS_NCHAR".
The clause CHARACTER SET [IS] NCHAR_CS can be specified in character variable declarations. This has the same effect as naming the variable in the NLS_CHAR precompiler option. See "CHARACTER SET [IS] NCHAR_CS".
A new clause, CONVBUFSZ, is available in the EXEC SQL VAR statement, for character set conversion. See "Using the EXEC SQL VAR and TYPE Directives".
This option specifies the default mapping of C host char variables. Character strings are CHARZ (fixed-length blank-padded and 0-terminated) by default in Oracle8i. For more information, see "Precompiler Option CHAR_MAP".
SQLLIB functions have new aliases, which co-exist with the old function names for this release of Pro*C/C++. See "New Names for SQLLIB Public Functions".
Pro*C/C++ now allows you to map C structures to Object types that you defined for the database server.
See Chapter 17, "Objects" for a description of how to access objects in a Pro*C/C++ program using an associative interface and a navigational interface (Executable Embedded SQL Extensions).
A sample program that illustrates how to access objects is listed in "Sample Code for Navigational Access".
A new chapter describes the Object Type Translator (OTT) utility, which maps database object types to C structs for use in OCI and Pro*C/C++ applications. OTT is run before running the precompiler. See Chapter 19, "The Object Type Translator".
You can mix OCI function calls with embedded SQL statements in your application. New OCI interoperability functions, are available, as well as library routines to manipulate OCIString and OCINumber datatypes. For a description of Pro*C/C++ object support, see Chapter 17, "Objects".
An embedded SQL statement interface allows LOBs (large objects) to be used in precompiler applications. How LOBs are used, the internal and external LOBs, and comparisons with other ways to handle LOBs are presented. A presentation of each new SQL statement is made. Sample code shows how to use the LOB interface. See the chapter Chapter 16, "Large Objects (LOBs)" for complete details.
The complete ANSI implementation of dynamic SQL Method 4 through embedded SQL statements is presented in Chapter 14, "ANSI Dynamic SQL" . An overview with simple examples is presented. This is followed by a complete discussion of the new SQL statements. Sample programs from the
demo directory are then shown.
The two kinds of collections (VARRAYs and Nested Tables) are presented and compared to other datatypes. Then the embedded SQL commands that manipulate collections are described. See Chapter 18, "Collections".
Support for Unicode(UCS2) character set in bind and define variables is described in "Unicode Variables".
This precompiler option speeds up database access by "prefetching" values, thus cutting down the number of network round-trips. See "The PREFETCH Precompiler Option".
External procedures written in C can be called from PL/SQL blocks. The REGISTER CONNECT embedded SQL statement is used by the procedures. See "External Procedures".
Stored procedures written in Java can be called from your application. For information on how to call a procedure written in Java, see "Stored PL/SQL and Java Subprograms".
This clause is allowed in INSERT, DELETE, and UPDATE statements. See "The DML Returning Clause".
The support for universal ROWID datatype is presented. Index-organized tables use this concept. See "Universal ROWIDs".
To set these privileges using the CONNECT statement, see"Connecting to the Database".
The CLOSE_ON_COMMIT micro precompiler option allows you to choose whether or not to close all cursors when a COMMIT is executed and the macro option MODE=ANSI. See "The CLOSE_ON_COMMIT Precompiler Option" and "CLOSE_ON_COMMIT".
Many applications have been written under the assumption that character strings are of varying length (such as VARCHAR2). By default, Oracle8i uses fixed-length, blank-padded, NULL-terminated character strings (CHARZ), to conform to the current SQL standards.
If your application assumes that character strings are varying in length (and this is especially important in the string comparison semantics), then you should precompile your application using the options DBMS=V8 and CHAR_MAP=VARCHAR2. See "Handling Character Data" for details.
See the description of the DBMS options in "DBMS" for a complete list of the effects of the DBMS options.
Error and warning codes are different between earlier releases of Pro*C/C++ and the current release. See Oracle8i Error Messages for a complete list of codes and messages.
The runtime messages issued by SQLLIB now have the prefix SQL-, rather than the RTL- prefix used in earlier Pro*C/C++ and Pro*C releases. The message codes remain the same as those of earlier releases.
When precompiling with SQLCHECK=SEMANTICS, PLS is the prefix used by the PL/SQL compiler. Such errors are not from Pro*C/C++.
When LINES=YES, error messages issued by the C compiler always refer to your original source files, not the modified (precompiled) source file. This also allows you to step through the original source code using most debuggers. See "LINES".
Existing applications written in Pro*C/C++ will work unchanged with an Oracle8i server.
For many more details, see Oracle8i Migration.