Oracle Call Interface (OCI)

If you have applications that were written by using the Oracle Call Interface (OCI), you may want to consider rewriting them by using ODBC. The OCI is specific to the Oracle RDBMS and cannot be used with Microsoft SQL Server or any other database.

In most cases, you can replace OCI functions with the appropriate ODBC functions, followed by relevant changes to the supporting program code. The remaining non-OCI program code should require minimal modification. The example shows a comparison of the OCI and ODBC statements required for establishing a connection to an Oracle database.

Oracle Call Interface Oracle ODBC
rcl = olog(&logon_data_area, &host_data_area, user_name, -1, (text*)
0, -1, (text) 0, -1, OCI_LM_DEF);
rcl = SQLConnect(hdbc1,
(SQLCHAR*) ODBC_dsn, (SQLSMALLINT) SQL_NTS,
(SQLCHAR*) user_name, (SQLSMALLINT) SQL_NTS,
(SQLCHAR*) user_password, (SQLSMALLINT) SQL_NTS);

The table suggests conversions between Oracle OCI function calls and ODBC functions. These suggested conversions are approximate. There may not be an exact match in the conversion process. Your program code might require additional revision to obtain similar functionality.

OCI function ODBC function
Obindps SQLBindParameter
Obndra SQLBindParameter
Obndrn SQLBindParameter
Obndrv SQLBindParameter
Obreak SQLCancel
Ocan SQLCancel, SQLFreeStmt
Oclose SQLFreeStmt
Ocof SQLSetConnectOption
Ocom SQLTransact
Ocon SQLSetConnectOption
Odefin SQLBindCol
Odefinps SQLBindCol
Odescr SQLDescribeCol
Oerhms SQLError
Oexec SQLExecute, SQLExecDirect
Oexfet SQLExecute, SQLExecDirect, and SQLFetch
Oexn SQLExecute, SQLExecDirect
Ofen SQLExtendedFetch
Ofetch SQLFetch
Oflng SQLGetData
Ogetpi SQLGetData
Olog SQLConnect
Ologof SQLDisconnect
Oopen SQLExecute, SQLExecDirect
Oparse SQLPrepare
Orol SQLTransact