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 In This Release

This section describes features which are new in this release.

New External Datatypes

Five new external datatypes are available:

  • INTERVAL DAY TO SECOND

  • INTERVAL YEAR TO MONTH

  • TIMESTAMP

  • TIMESTAMP WITH TIMEZONE

  • TIMESTAMP WITH LOCAL TIMEZONE

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

Changing Passwords at Runtime

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

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

A new clause, CONVBUFSZ, is available in the EXEC SQL VAR statement, for character set conversion. See "The EXEC SQL VAR and TYPE Directives".

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

New Names for SQLLIB Functions

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

New Actions in WHENEVER Statement

The DO BREAK and DO CONTINUE actions are now supported by the embedded SQL directive WHENEVER. See "Using the WHENEVER Directive" and "WHENEVER (Embedded SQL Directive)".

Object Type Support

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

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.

See Also:

"UTF16_CHARSET"

PREFETCH Option

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

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

Calling Java from PL/SQL

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

DML Returning Clause

This clause is allowed in INSERT, DELETE, and UPDATE statements. See "The DML Returning Clause".

Universal ROWID

The support for universal ROWID datatype is presented. Index-organized tables use this concept. See "Universal ROWIDs".

SYSDBA/SYSOPER Privileges in CONNECT Statements

To set these privileges using the CONNECT statement, see"Connect to the Database".

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 Oracle environment, the following actions must be taken:

  • Relink existing Pro*C/C++ applications with the Oracle SQLLIB library.

Specific functionality previously available in Pro*C/C++ is no longer supported in Oracle. This includes:

  • The Graphical User Interface (GUI) for Pro*C/C++ on a computer running Windows NT Server or Windows NT Workstation

  • The Intype File Assistant (IFA) for Pro*C/C++ for the Object Type Translator (OTT) on a computer running the Windows NT Server or Windows NT Workstation

For specific information about upgrading to Oracle 11g, see Oracle Database Upgrade Guide.