Is Interoperability Achievable with ODBC?: Slide 9 of 10.
Click slide for next, or goto previous, first, last slides or back to thumbnail layout.
Click slide for next, or goto previous, or back to thumbnail layout.
There are two more cases where the programmer specifies data types: when parameters are bound to the statement and when the results of the statement are retrieved. In each case one must specify the application type and the database type used in the database. If these data types differ, the ODBC driver converts the data çon the flyá.
In this diagram we show the problems when the application type, the ODBC type and the database type are not the same.
An application program inserts an integer value into a table. For example, ORACLE only provides NUMBER and FLOAT as numeric types, whereas the application types might be LONGINT and LONGREAL. The application type LONGINT is mapped to the ODBC type INTEGER and the database type NUMBER. The database type NUMBER in return is mapped to the ODBC type CHAR and application type ARRAY OF CHAR because it is generally not possible, to represent the database type NUMBER (fixed numeric precision) within the numeric application types.
The main point is that the mapping of application types to database types and back cannot be done without loss of information. The programmer must therefore be aware of the fact that the data types of the inserted data do not necessarily equal the data types of the retrieved data.