| Pro*C/C++ Precompiler Programmer's Guide
Part Number A89861-01
This appendix lists the new features offered in the Pro*C/C++ Precompiler, release 8i and 9i. Each new feature is described briefly, and a reference to the more complete description in the chapters is provided. This appendix contains the following topics:
National Language Support (NLS) has been re-named Globalization Support
Five new external datatypes are available:
INTERVAL DAY TO SECOND
INTERVAL YEAR TO MONTH
TIMESTAMP WITH TIMEZONE
TIMESTAMP WITH LOCAL TIMEZONE
Pro*C/C++ supports the use of arrays of structs which enable you to perform multirow, multicolumn 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 National 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 National Character Set, NCHAR will be supported. 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 "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. 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 provides the ability 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 example program that illustrates how to access objects is listed in "Example 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. Example 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. Example 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(UCS16) character set in bind and define variables is described in "Unicode Variables".
Specifies the default character set form used by UNICODE(UTF16) variables for performance and backward compatibility.
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"Connect to the Database".
The CLOSE_ON_COMMIT micro precompiler option provides the ability 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, fixed-length, blank-padded, NULL-terminated character strings (CHARZ) are used 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 "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 Oracle9i Database 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 enables stepping through the original source code using most debuggers. See "LINES".
For existing Pro*C/C++ applications to work in the Oracle9i environment, the following actions must be taken:
Specific functionality previously available in Pro*C/C++ is no longer supported in Oracle9i. This includes:
For specific information about migrating to Oracle9i, see Oracle9i Database Migration.