Index   Search   Add FAQ   Ask Question  
 

Please note: This page is not maintained anymore. Please visit the new and improved page at http://www.orafaq.com/wiki/Oracle_Call_Interfaces

Oracle Call Interface FAQ

$Date: 27-Sep-2000 $
$Revision: 1.11 $
$Author: Frank Naudé $

Topics

  • What is the Oracle Call Interface?
  • Should one use OCI or the Oracle Precompilers?
  • How does one write an OCI program?
  • How does one compile and link an OCI program?
  • Where can one get more info about OCI?

  • Back to Oracle FAQ Index

    What is the Oracle Call Interface?

    The Oracle Call Interface (OCI) is a set of low-level APIs (Application Programming Interface Calls) used to interact with Oracle databases. It allows one to use operations like logon, execute, parse, fetch, etc. OCI programs are normally written in C or C++, although they can be written in almost any programing language.

    Unlike with the Oracle Precompilers (like Pro*C and Pro*COBOL), OCI programs are not precompiled. For more information about the other language precompilers, read the Oracle Precompilers FAQ.

  • Back to top of file

  • Should one use OCI or the Oracle Precompilers?

    OCI is superior to Pro*C in the following ways: Common problems with OCI: An OCI application program must do the following:

  • Back to top of file

  • How does one write an OCI program?

    Look at this very basic sample Oracle OCI8 program:

  • Back to top of file

  • How does one compile and link an OCI program?

    1. Write an OCI program (e.g. myoci.c). You can find examples in the $ORACLE_HOME/rdbms/demo directory.

    2. Copy the make file $ORACLE_HOME/rdbms/demo/demo_rdbms.mk into the directory where your OCI program is located. You can also copy some of the sample OCI files (cdemo1.c, etc.) provided by Oracle to compile and link.

    3. Issue the following command
      	make -f demo_rdbms.mk build EXE=cdemo1 OBJS=cdemo1.o

  • Back to top of file

  • Where can one get more info about OCI?

  • Back to top of file
  • HOME | ASK QUESTION | ADD FAQ | SEARCH | E-MAIL US