Standard conversions

Standard conversions exist between the HCL OneDB™ SQL data types and the HCL OneDB ODBC Driver C data types.

Only HCL OneDB can convert data to SQL_C_BIT.

The HCL OneDB ODBC driver C data types, SQL_C_BINARY, SQL_C_CHAR, and SQL_C_WCHAR, support conversion between all HCL OneDB SQL data types listed in the following tables.

The following tables show the supported conversions between the HCL OneDB SQL data types and the HCL OneDB ODBC Driver C data types.

Table 1. Supported conversions between HCL OneDB SQL data types and ODBC Driver C data types

A five-column table that shows the supported conversions between HCL OneDB SQL data types and ODBC Driver C data types.

SQL data type ODBC driver C data types (target type)
SQL_C_BIT SQL_C_DATE SQL_C_DOUBLE SQL_C_FLOAT
BOOLEAN yes no no no
CHAR, CHARACTER yes no yes yes
CHARACTER VARYING yes no yes yes
DATE no yes no no
DATETIME no yes no no
DEC, DECIMAL yes no yes yes
DOUBLE PRECISION no no yes yes
FLOAT no no yes yes
INT, INTEGER yes no yes yes
INT8 no no no no
LVARCHAR yes yes no yes
MONEY no yes yes yes
NUMERIC no yes yes yes
REAL no yes yes yes
SERIAL no yes yes yes
SMALLFLOAT yes no yes yes
SMALLINT yes no yes yes
TEXT yes yes yes yes
VARCHAR yes yes yes yes
Table 2. Supported conversions between HCL OneDB SQL data types and ODBC Driver C data types

A five-column table that shows the supported conversions between HCL OneDB SQL data types and ODBC Driver C data types.

SQL data type ODBC driver C data types (target type)
SQL_C_LONG SQL_C_NUMERIC SQL_C_SHORT SQL_C_SLONG
BIGINT yes yes no yes
BIGSERIAL yes yes yes yes
BYTE no no no no
CHAR, CHARACTER yes yes yes yes
CHARACTER VARYING yes yes yes yes
DEC, DECIMAL yes yes yes yes
DOUBLE PRECISION yes yes yes yes
FLOAT yes yes yes yes
INT, INTEGER yes yes yes yes
INT8 yes yes no yes
LVARCHAR yes no yes yes
MONEY yes yes yes yes
NUMERIC yes yes yes yes
REAL yes yes yes yes
SERIAL yes no yes yes
SERIAL8 yes yes yes yes
SMALLFLOAT yes yes yes yes
SMALLINT yes yes yes yes
TEXT yes yes yes yes
VARCHAR yes yes yes yes
Table 3. Supported conversions between HCL OneDB SQL data types and ODBC Driver C data types

A five-column table that shows the supported conversions between HCL OneDB SQL data types and ODBC Driver C data types.

SQL data type ODBC driver C data types (target type)
SQL_C_SSHORT SQL_C_STINYINT SQL_C_TIMESTAMP
BIGINT yes no no
BIGSERIAL yes no no
CHAR, CHARACTER yes yes no
CHARACTER VARYING yes yes no
DATE no no yes
DATETIME no no yes
DEC, DECIMAL yes yes no
DOUBLE PRECISION yes yes no
FLOAT yes yes no
INT, INTEGER yes yes no
INT8 yes no no
LVARCHAR yes yes yes
MONEY yes yes yes
NUMERIC yes yes yes
REAL yes yes yes
SERIAL yes yes yes
SERIAL8 yes no no
SMALLFLOAT yes yes no
SMALLINT yes yes no
TEXT yes yes yes
VARCHAR yes yes yes

The ODBC driver C data type SQL_C_ULONG supports conversion between all the SQL data types listed in the following table.

Table 4. Supported conversions between HCL OneDB SQL data types and ODBC Driver C data types

A five-column table that shows the supported conversions between HCL OneDB SQL data types and ODBC Driver C data types.

SQL data type ODBC driver C data types (target type)
SQL_C_TINYINT SQL_C_USHORT SQL_C_UTINYINT
BIGINT no no no
BIGSERIAL no yes no
CHAR, CHARACTER yes yes yes
CHARACTER VARYING yes yes yes
DEC, DECIMAL yes yes yes
DOUBLE PRECISION yes yes yes
FLOAT yes yes yes
INT, INTEGER yes yes yes
INT8 no no no
LVARCHAR yes yes yes
MONEY yes yes yes
NUMERIC yes yes yes
REAL yes yes yes
SERIAL yes yes yes
SERIAL8 no yes no
SMALLFLOAT yes yes yes
SMALLINT yes yes yes
TEXT yes yes yes
VARCHAR yes yes yes