Oracle

Requirements

  • Build: nothing; the driver includes ODPI-C.
  • Run: the Oracle client libraries (libclntsh.so), for example from the Oracle Instant Client. ODPI-C loads them at run time: their directory must be in LD_LIBRARY_PATH (or set ORACLE_HOME).

Connection string

oracle://[user.password@]host[:port]/service

The driver connects with the Easy Connect syntax //host:port/service. Only service names are supported, not SIDs nor tnsnames.ora aliases.

Example, with the Oracle Free container:

oracle://localhost:1521/FREEPDB1

Options and environment

  • client_encoding is ignored: set NLS_LANG before running the program.
  • The variables DPI_DEBUG_LEVEL and DPI_DEBUG_PREFIX enable the traces of ODPI-C.

Transactions

Oracle always works in a transaction: with the default native autocommit mode, a program must COMMIT its changes, as with Pro*COBOL.

Data types

  • ROWID columns are fetched as character strings.
  • Parameters can be written :1, :name, or $1 (converted by the driver).
NoteTo be completed

DATE/TIMESTAMP conversions, NUMBER precision, CLOB/BLOB.

Testing

NoteTo be completed

How to run the Oracle Free container (gvenzl/oracle-free) and create a test user.