Oracle Call Interface Getting Started for Windows Platforms | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
The Oracle Call Interface (OCI) is an application programming interface (API) for accessing an Oracle database from a C program.
You make calls directly to the OCI functions from within your C program to direct the execution of your SQL statements.
OCI requires more programming than Pro*C and should be used to develop applications which require greater control over processing SQL statements.
You can build OCI applications using techniques detailed in this book. You do not need to precompile the source code, because OCI applications contain no EXEC SQL statements.
The Oracle Call Interface for Windows platforms package includes:
OCIW32.DLL is included with OCI Release 7.3 for Windows NT/95. It contains only the OCI layer. This new DLL dynamically loads any Oracle client DLL available on user systems. The impact of this is that users do not generally need be concerned with which Oracle client DLLs are available on their systems.
However, functionality available to users is limited to the DLLs they have loaded. If a function is not available in the loaded client DLL, an error is returned when that function is called.
OCIW32.DLL attempts to translate the variable ORAOCI. If the variable exists, it's value is expected to be the name of an Oracle client DLL. If the variable does not exist, or if using it's 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 instead loaded on demand at runtime. No errors are returned when attempting to load function pointers.
When a user calls a function, check to see if a pointer exists, and call the function if it does. If it does not, return an error (ORA-1010'Invalid OCI Operation')
Note A debug mode is available. Set ORAOCI_DEBUG to some value, and a number of informational messages boxes are raised. |
The following directories are searched in this order by LoadLibrary:
OCIW16.DLL is included with OCI Release 7.3 for Windows. It contains only the OCI layer. This new DLL dynamically loads any Oracle client DLL available on user systems. This feature means that users need not generally be concerned with which Oracle client DLLs are available on their systems.
However, functionality available to users is limited to the DLLs they have loaded. If a function is not available in the loaded client DLL, an error is returned when that function is called.
OCIW16.DLL attempts to translate the variable ORAOCI. If the variable exists, it's value is expected to be the name of an Oracle client DLL. If the variable does not exist, or if using it's 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, OCIW16.DLL 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 instead loaded on demand at runtime. No errors are returned when attempting to load function pointers.
When a user calls a function, check to see if a pointer exists, and call the function if it does. If it does not, return an error (ORA-1010'Invalid OCI Operation')
Note A debug mode is available. Set ORAOCI_DEBUG to some value, and a number of informational messages boxes are raised. |
The following directories are searched in this order by LoadLibrary:
No special link options are required. Link your application with OCIW32.LIB (or OCIW16.LIB) instead of
When you install Oracle Call Interface for Windows NT/95, an Oracle home directory is created on the hard drive of your computer. Your Oracle home directory, as described below, contains the following subdirectories and files.
Depending on the supported products you choose to install, Oracle Installer also creates the appropriate product subdirectory.
For example, if you install Oracle Call Interface for Windows NT/95 Release 7.3:
\OCI73 | contains Oracle Call Interface for Windows Platforms subdirectories under \ORANT, \ORAWIN95, or \ORAWIN |
The OCI73 subdirectory contains the following subdirectories and includes the OCI files listed below.
The OCI installation procedure copies a set of sample programs and their corresponding project files into the \SAMPLE 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. After you have finished using these sample programs, you can delete them if you choose. For details, see "Project Files" in Chapter 3.
OCI sample programs are built by opening the .MAK file provided with each sample program in Microsoft Visual C++ and doing a project build.
Sample Program Groups | Contents |
OCI (WINDOWS) | OCI C sample programs for Windows NT |
OCI C (GENERAL) | OCI C sample programs (QuickWin) |
OCI C (NONBLOCKING) | OCI C sample nonblocking programs |
OCI non-blocking functionality is supported against Oracle7 Release 7.2 or later databases, and requires that you use SQL*Net Release 2.2 or later on both the client and server if you are running against a remote database.
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |