How does one compile and link an OCI program?

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

  • 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.

  • Issue the following command

    make -f demo_rdbms.mk build EXE=cdemo1 OBJS=cdemo1.o