Pro*C/C++ Precompiler Programmer's Guide
Release 8.1.5

A68022-01

Library

Product

Contents

Index

Prev Next

A
New Features

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.

Topics are:

Array of Structs

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

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

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 in Oracle8i. 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 Statement" and "WHENEVER (Embedded SQL Directive)".

Object Type Support

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

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. Sample code shows how to use the LOB interface. See the chapter Chapter 16, "Large Objects (LOBs)" for complete details.

ANSI Dynamic SQL

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.

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

Unicode Support

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

PREFETCH Option

This precompiler option speeds up database access by "prefetching" values, thus cutting down the number of network round-trips. See "The PREFETCH 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"Connecting to the Database".

CLOSE_ON_COMMIT Precompiler Option

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

Migration From Earlier Releases

Existing applications written in Pro*C/C++ will work unchanged with an Oracle8i server. To migrate to Oracle8i before adding new functionality to your application, re-link with the new SQLLIB library.

Pro*C/C++ release 8.x applications will work with an Oracle7 server, if they do not use any new features.

When the new features are added to an existing Pro*C/C++ application, use the Pro*C/C++ release 8.x precompiler, compile, and link.

Character Strings

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

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




Prev

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index