Oracle Call Interface Getting Started
Release 8.1.6 for Windows

Part Number A73022-01





Go to previous page Go to next page

Introducing the Oracle Call Interface

This chapter provides introductory information to help you get started with Oracle Call Interface (OCI) for Windows. Specific topics discussed are:

What is the Oracle Call Interface?

The Oracle Call Interface (OCI) is an application programming interface (API) that allows applications written in C to interact with one or more Oracle Servers. OCI gives your programs the capability to perform the full range of database operations that are possible with Oracle8i database, including SQL statement processing and object manipulation.

Release 8.1 New Features

OCI includes many new functions and performance enhancements that extend the capabilities of the OCI to handle objects in an Oracle8i database. To use object functionality, you must have installed Oracle8i Enterprise Edition.

For Windows platforms, OCI includes support for applications written with earlier releases (7.x/8.x) of OCI. Oracle has now removed any version number from the library name oci.lib.

OCI Release 7.x Functions

OCI functions available in Release 7.x are still available, but they are not able to take full advantage of new Oracle8i features. Oracle recommends that existing applications start using the new calls to improve performance and provide increased functionality.

For Win32 applications running on Windows NT or Windows 95/98, this means that these applications will need to migrate to the new Release 8.x OCI calls in order to continue to be supported. In Release 8.x, the library and DLL containing the OCI calls is named oci.lib and oci.dll. In Release 7.x, they were named ociw32.lib and ociw32.dll. At some point in the future, ociw32.lib and ociw32.dll will no longer be supported or released, making migration to the new calls mandatory.

What is Included in the OCI Package?

The Oracle Call Interface for Windows package includes:

The OCI for Windows package includes the additional libraries required for linking your OCI programs on Windows NT and Windows 95/98.

Oracle Directory Structure

When you install the Oracle Call Interface for Windows, Oracle Universal Installer creates an oracle_base\oracle_home directory on the hard drive of your computer. The default Oracle home directory is c:\oracle\ora81.

The OCI files are located in the oracle_base\oracle_home directory, as are the library files needed to link and run OCI applications, and link with other Oracle for Windows NT products, such as Oracle Forms.

The oracle_base\oracle_home directory contains the following directories that are relevant to OCI:

Directory Name  Contents 


Executable and help files 


Oracle Call Interface directory for Windows files 


Header files, such as ocidfn.h and ociapr.h 

\oci\lib\msvc, \oci\lib\bc 

Library files, for Borland and Microsoft, that link into OCI applications 


Sample programs 


Object Type Translator utility and default configuration file 

Sample Programs

When OCI is installed, a set of sample programs and their corresponding project files are copied to the oracle_base\oracle_home\oci\samples subdirectory. Oracle recommends that you build and run these sample programs to verify that OCI has been successfully installed and to familiarize yourself with the steps involved in developing OCI applications.

To build a sample, run a batch file (make.bat) at the MS-DOS command prompt. For example, to build the cdemo1.c sample, enter the following command:

C:> make cdemo1

If you are using the Borland Compiler, enter the following command:

C:> bcmake cdemo1

After you finish using these sample programs, you can delete them if you choose.

A sample OCI application specific to Windows platforms is included. cdemomt.c demonstrates OCI multithreading which is the thread safety feature of Oracle8 is also included on the Windows platforms. This sample program requires the EMP table from the default database. The program spawns two simultaneous threads that attempt to insert different employee names with the same ID numbers. Thread synchronization is demonstrated.

ociucb.c should be compiled using ociucb.bat. This batch files creates a DLL and places it in the oracle_base\oracle_home\bin directory. To load user callback functions, set the environment/registry variable ORA_OCI_UCBPKG = OCIUCB.

See Also:

For more information on multithreading, see the Oracle Call Interface Programmer's Guide

Go to previous page Go to next page
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.