A New Features

This appendix lists the new features offered in the Pro*C/C++ Precompiler. 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:

New External Datatypes

New In Previous Releases

This section describes features which were new in prior releases.

Array of Structs

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".

Precompiled Header Files

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".

CALL Statement

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)".

Support for National Character Sets

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".

CHAR_MAP Precompiler Option

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".

Object Type Translator

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".

LOB Support

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, "LOBs" for complete details.

ANSI Dynamic SQ

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.

Collections

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".

Miscellaneous Topics

This section covers a variety of topics of interest to the Pro*C/C++ programmer.

Unicode Support

Support for Unicode(UCS16) character set in bind and define variables is described in "Unicode Variables".

UTF16_CHARSET Option

Specifies the default character set form used by UNICODE(UTF16) variables for performance and backward compatibility.

SYSDBA/SYSOPER Privileges in CONNECT Statements

CLOSE_ON_COMMIT Precompiler Option

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 "#include <stdio.h>" and "CLOSE_ON_COMMIT".

Character Strings

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 Message Codes

Error and warning codes are different between earlier releases of Pro*C/C++ and the current release. See Oracle 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++.

LINES Option

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".

Migration From Earlier Releases

For existing Pro*C/C++ applications to work in the Oracle9i environment, the following actions must be taken: