B OCI Demonstration Programs

Lists example programs with sample code demonstrating the allocation and use of OCI handles.

Oracle provides code examples illustrating the use of OCI calls. These programs are provided for demonstration purposes, and are not guaranteed to run on all operating systems.

You must install the demonstration programs as described in Oracle Database Examples Installation Guide. The location, names, and availability of the programs may vary on different operating systems. On a Linux or UNIX workstation, the programs are installed in the $ORACLE_HOME/rdbms/demo directory. For Windows systems, see Getting Started with OCI for Windows.

OCI header files that are required for OCI client application development on Linux or UNIX platforms are in the $ORACLE_HOME/rdbms/public directory. The demo_rdbms.mk file is in the $ORACLE_HOME/rdbms/demo directory and serves as an example makefile. On Windows systems, make.bat is the analogous file in the samples directory. There are instructions in the makefiles.

Unless you significantly modify the demo_rdbms.mk file, you are not affected by changes you make as long the demo_rdbms.mk file includes the $ORACLE_HOME/rdbms/public directory. Ensure that your highly customized makefiles have the $ORACLE_HOME/rdbms/public directory in the INCLUDE path.

Development of new makefiles to build an OCI application or an external procedure should consist of the customizing of the makefile provided by adding your own macros to the link line. However, Oracle requires that you keep the macros provided in the demo makefile, as it results in easier maintenance of your own makefiles.

When a specific header or SQL file is required by the application, these files are also included as specified in the demonstration program file. Review the information in the comments at the beginning of the demonstration programs for setups and hints on running the programs.

Table B-1 lists the important demonstration programs and the OCI features that they illustrate. Look for related files with the .sql extension.

Table B-1 OCI Demonstration Programs

Program Name Features Illustrated

cdemo81.c

Using basic SQL processing with release 8 functionality

cdemo82.c

Performing basic processing of user-defined objects

cdemocor.c

Using complex object retrieval (COR) to improve performance

cdemodr1.c cdemodr2.c cdemodr3.c

Using INSERT, UPDATE, and DELETE statements, with RETURNING clause used with basic data types, LOBs and REFs

cdemodsa.c

Describing information about a table

cdemodsc.c

Describing information about an object type

cdemofo.c

Registering and operating application failover callbacks

cdemolb.c

Creating and inserting LOB data and then reading, writing, coping, appending, and trimming the data

cdemolb2.c

Writing and reading of CLOB and BLOB columns with stream mode and callback functions

cdemolbs.c

Writing and reading to LOBs with the LOB buffering system

cdemobj.c

Pinning and navigation of REF object

cdemocoll.c

Inserting and selecting of nested table and varray

cdemorid.c

Using INSERT, UPDATE, DELETE statements and fetches to get multiple rowids in one round-trip

cdemoses.c

Using session switching and migration

cdemothr.c

Using the OCIThread package

cdemosyev.c

Registering predefined subscriptions and specifying a callback function to be invoked for client notifications (for more information about Advanced Queuing, see Oracle Database Advanced Queuing User's Guide)

ociaqdemo00.c

ociaqdemo01.c

ociaqdemo02.c

ociaqarrayenq.c

ociaqarraydeq.c

Database Advanced Queuing. Enqueues 100 messages

Dequeues messages by blocking

Listens for multiple agents

Array enqueue of 10 messages

Array dequeue of 10 messages

cdemodp.c, cdemodp_lip.c

Loading data with the direct path load functions

cdemdpco.c

cdemdpno.c

cdemdpin.c

cdemdpit.c

cdemdpro.c

cdemdpss.c

Loading a column object with the direct path load functions

Loading a nested column object with the direct path load functions

Loading derived type (inheritance) - direct path

Loading an object table with inheritance - direct path

Loading a reference with the direct path load functions

Loading SQL strings with the direct path load functions

cdemoucb.c, cdemoucbl.c

Using static and dynamic user callbacks

cdemoupk.c, cdemoup1.c, cdemoup2.c

Using dynamic user callbacks with multiple packages

cdemodt.c

Datetime and interval example. Demonstrates IN and OUT binds with PL/SQL procedure or function

cdemosc.c

Scrollable cursor

cdemol2l.c

Accesses LOBs using the LONG API (Data Interface)

cdemoin1.c

Inheritance demo that modifies an inherited type in a table and displays a record from the table

cdemoin2.c

Inheritance demo to do attribute substitutability

cdemoin3.c

Inheritance demo that describes an object, inherited types, object tables, and a sub-table

cdemoanydata1.c

Anydata demo. Inserts and selects rows to and from anydata table

cdemoanydata2.c

Anydata demo. Creates a type piecewise using OCITypeBeginCreate() and then describes the new type created

cdemoqc.c

Query caching using SQL hints

cdemoqc2.c

Query caching using SQL hints and table annotation

cdemosp.c

Session pooling

cdemocp.c

Connection pooling

cdemocpproxy.c

Connection pooling with proxy functionality

cdemostc.c

Statement caching

cdemouni.c

Program for OCI UTF16 API

nchdemo1.c

Shows NCHAR implicit conversion feature and code point feature