User`s guide

The Oracle Call Interface
Programmatic Interfaces 5-9
COBOL programming languages. OCI calls are fully described in the Oracle Call
Interface Programmer's Guide.
For restrictions refer to "Known Problems, Restrictions and Workarounds" in Oracle
Database Installation and Administration Guide for Fujitsu BS2000/OSD.
5.5.1 Linking OCI
To link OCI program files, you need:
The Common Run-Time Environment, CRTE.
The Pro* Library (
$ORAC1120.PRO.LIB
), which contains the stub modules
OCI$COB
and
PROSTUB.
At run time,
PROSTUB
loads the prelinked module
ORAPRO
, which
contains the actual
SQLLIB
code.
When linking OCI COBOL programs,
OCI$COB
must always be included before
PROSTUB
.
To link your program, you should create your own user-specific link procedure. An
example of such a link procedure is included in your Oracle Database Software under
the name
$ORAC1120.P.PROLNK
.
For example, to link your program using this sample procedure, enter the following:
/CALL-PROCEDURE $ORAC1120.P.PROLNK,dir,module,TYPE=OCIC
or:
/CALL-PROCEDURE $ORAC1120.P.PROLNK,dir,module,TYPE=OCICOB
where the module to be linked is stored in
dir.LIB
.
Example files are shipped under:
$ORAC1120.RDBMS.DEMO.*.C
$ORAC1120.RDBMS.DEMO.*.COB
5.5.2 Optional Parameters
C does not omit optional parameters. Hence, all parameters must be specified. (Refer
to the sample C program).
If a length parameter is -1, then the length is determined by scanning the associated
string parameter for a null byte. Missing address parameters may be specified as
NULL
.
In C, the -1 should be cast to the proper type.
For COBOL, you may omit optional trailing parameters; the call interface provides
default values.
Note: The precompiler products from Oracle offer a higher level
interface to the Oracle Database. One precompiler call is translated to
several OCI calls. As the precompilers are simpler to use, and in a few
cases offer more or different functionality than OCI, you may prefer to
use the precompilers for some applications.
Note: You must use BINDER instead of TSOSLNK.