Oracle Call Interface Getting Started for Windows Platforms
Release 8.0
A54626_01

Library

Product

Contents

Index


Prev Next

1
Introduction

This chapter covers:

What is the Oracle Call Interface (OCI)?

The Oracle Call Interface (OCI) is an application programming interface (API) that allows an application developer to use a third-generation language's native procedures or function calls to access the Oracle database server and control all phases of SQL statement execution. The OCI provides a library of standard database access and retrieval functions in the form of a dynamic runtime library, OCIW32, that can be linked in by the application. This eliminates the need to embed SQL or PL/SQL within 3GL programs.

More Information:

For general information on using OCI see the Programmer's Guide to the Oracle Call Interface Vols I & II.  

What is Included in the Oracle Call Interface for Windows NT/95 Package?

The Oracle Call Interface for Windows NT/95 package includes:

ORA803.DLL

ORA803.DLL is the Oracle client DLL that contains the Release 8 OCI layer.

OCIW32.DLL

OCIW32.DLL is included with OCI Release 8.0 for Windows NT/95. It contains only the old 7.x OCI layer. This DLL dynamically loads Oracle client DLL available on user systems. However, this DLL only contains the 7.x OCI calls.With Release 8 installed, OCI32.DLL loads up 803.DLL and passes the functions to that DLL described in the implementation below.

Implementation

OCIW32.DLL attempts to translate the variable ORAOCI. If the variable exists, its value is expected to be the name of an Oracle client DLL. If the variable does not exist, or if using its value to call LoadLibrary fails, then OCIW32.DLL continues to search through a predefined list of known Oracle client DLL names (most recent to least recent RSFs). If no Oracle client DLLs are found, an error is returned.

Next, OCIW32 fills in a table of function pointers, one for each OCI call. Obsolete OCI functions are not immediately loaded since they are most likely not to be used (and may be omitted in future OCI releases). These are loaded on demand at runtime instead. No errors are returned when attempting to load function pointers.

When a user calls a function in OCIW32.DLL, the function in OCIW32.DLL checks to see if the corresponding function in the Oracle client DLL exists. If the function does exist, it is called by OCIW32.DLL. If it does not, the error "ORA-1010: Invalid OCI Operation" is returned by OCIW32.DLL.

Note:

A debug mode is available. Set ORAOCI_DEBUG to any value, and a number of informational messages boxes are raised.  

Loading of Client DLLs (when LoadLibrary() is used)

The following directories are searched in this order by LoadLibrary:

Oracle Directory Structure

When you install Oracle Call Interface for Windows NT/95 an Oracle home directory is created on the hard drive of your computer The default Oracle home directory is \ORANT on Windows NT or \ORAWIN95 on Windows 95). The Oracle Call Interface for Windows NT/95 files are located in the Oracle home directory, as are the library files needed to link and run Oracle Call Interface for Windows NT/95 applications, as well as link with other Oracle Windows NT products, such as Oracle Forms.

Your Oracle home directory, as shown and described below, contains the following subdirectories and files:

The contents of the directories are listed below:

\BIN-executable programs and batch files for the Oracle database tools and the dynamic link libraries (DLLs) used by the SQL*Net driver and other applications

\DBS-some common SQL scripts and message files

\ORAINST-Oracle Installer files

Depending on the supported products you choose to install, the Oracle Installer also creates the appropriate product subdirectory.

For example, if you install Oracle Call Interface for Windows NT/95 Release 8.0:

\OCI80-holds the Oracle Call Interface for Windows NT/95 subdirectories under \ORANT (or ORAWIN95)

OCI Subdirectories

The OCI80 subdirectory under \ORANT (or ORAWIN95) contains the following subdirectories and includes the OCI files listed below.

\INCLUDE-header files, such as OCIDFN.H and OCIAPR.H

\LIB-Oracle libraries that link into Windows NT/95programs

\SAMPLES-C sample program directories. This subdirectory contains separate subdirectories for Microsoft and Borland samples.

OCI Sample Applications

The OCI installation procedure copies a set of sample programs and their corresponding project files into the \SAMPLES subdirectory (see table below). 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 command prompt. For example, to build the CDEMOMT.C sample:

MAKE CDEMOMT

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

A sample OCI application specific to Windows NT/95 is included with Oracle Call Interface for Windows NT/95. The application is described below.

CDEMOMT.C

CDEMOMT.C demonstrates OCI multithreading on the Windows NT platform. It requires the EMP table from the default database.

This program spawns two simultaneous threads that attempt to insert different employee names with the same ID numbers. Automatic mutexing is demonstrated.

Additional Information:

For more information on multithreading, refer to Programmer's Guide to the Oracle Call Interface.  

Translating Variables

Variables should be set in the Registry: HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE. This is for ORAOCI and ORAOCI_DEBUG.




Prev

Next
Oracle
Copyright © 1997 Oracle Corporation.
All Rights Reserved.

Library

Product

Contents

Index