

There are more OCI external data types than Oracle internal data types. OCI can perform a wide range of data type conversions when transferring data between an Oracle database and an OCI application. They are discussed here because it can be useful to understand how internal types can map to external types. External types provide a convenience for the programmer by making it possible to work with host language types instead of proprietary data formats.Įven though some external types are similar to internal types, an OCI application never binds to internal data types. In some cases, external data types are similar to internal types.

Similarly, when output variables are specified in a define call, the external representation of the retrieved data must be specified. When an OCI application binds input variables, one of the bind parameters is an indication of the external data type code (or SQLT code) of the variable. When data is transferred between an OCI client application and a database table, the OCI libraries convert the data between internal data types and external data types.Įxternal data types are host language types that have been defined in the OCI header files. In general, OCI applications do not work with internal data type representations of data, but with host language data types that are predefined by the language in which they are written. Examples of internal data types include NUMBER, CHAR, and DATE (see Table 5-1). Internally, Oracle represents data in particular formats known as internal data types. Inside a database, values are stored in columns in tables. The OCI application may retrieve data from database tables through SQL SELECT queries, or it may modify existing data in tables through INSERT, UPDATE, or DELETE statements. One of the main functions of an OCI program is to communicate with an Oracle database.
