Type conversions

You must map SQL data types to ITP data types. In the following table, you will find examples of how some common SQL data types should be mapped on ITP data types.

SQL data type

ITP data type

Remark

CHAR(n), VARCHAR(n)

C_CHAR(n+1)

The length specified for the ITP Field should be 1 larger than the length specified in the data source. This is to include the terminating 0 byte

DECIMAL(p,s), NUMERIC(p,s), SMALLINT, INTEGER, BIGINT, TINYINT

NUMERICAL(p+3 s)

The length specified for the ITP Field should be the precision of the column + 3. This is to include the sign, decimal delimiter and the terminating 0 byte. Precision and scale for numerical data types without an (p, s) notation are data source specific.

REAL, FLOAT, DOUBLE PRECISION

DOUBLE

The length of an ITP DOUBLE is fixed 8 bytes

SQL_WCHAR(n), SQL_WVARCHAR(n)

W_CHAR(n+2)

The length specified for the ITP field should be 2 larger than the length specified in the datasource. This is to include the 2 terminating 0 bytes.

In this table n stands for number of characters, p for precision and s for scale.