Standard SQL data types

View the values for the precision, scale, length, and display size for standard HCL OneDB™ ODBC Driver SQL data types.

The following table describes the precision, scale, length, and display size for the standard HCL OneDB ODBC Driver SQL data types.
HCL OneDB ODBC driver sql data type (fSqlType) Description
SQL_BIGINT
Precision
19. SQLBindParameter ignores the value of cbColDef for this data type.
Scale
0. SQLBindParameter ignores the value of ibScale for this data type.
Length
8 bytes
Display size
20 digits. One digit is for the sign.
SQL_BIT
Precision
1. SQLBindParameter ignores the value of cbColDef for this data type.
Scale
0. SQLBindParameter ignores the value of ibScale for this data type.
Length
1 byte
Display size
1 digit
SQL_CHAR
Precision
Same as the length
Scale
Not applicable. SQLBindParameter ignores the value of ibScale for this data type.
Length
The specified length. For example, the length of CHAR(10) is 10 bytes.
Display size
Same as the length.
SQL_DATE
Precision
10. SQLBindParameter ignores the value of cbColDef for this data type.
Scale
Not applicable. SQLBindParameter ignores the value of ibScale for this data type.
Length
6 bytes
Display size
10 digits in the format yyyy-mm-dd.
SQL_DECIMAL
Precision
The specified precision. For example, the precision of DECIMAL (12, 3) is 12.
Scale
The specified scale. For example, the scale of DECIMAL(12, 3) is 3.
Length
The specified precision plus 2. For example, the length of DECIMAL(12, 3) is 14 bytes. The two additional bytes are used for the sign and the decimal points because functions return this data type as a character string.
Display size
Same as the length.
SQL_DOUBLE
Precision
15. SQLBindParameter ignores the value of cbColDef for this data type.
Scale
Not applicable. SQLBindParameter ignores the value of ibScale for this data type.
Length
8 bytes
Display size
22 digits. The digits are for a sign, 15 numeric characters, a decimal point, the letter E, another sign, and 2 more numeric characters.
SQL_INTEGER
Precision
10. SQLBindParameter ignores the value of cbColDef for this data type.
Scale
0. SQLBindParameter ignores the value of ibScale for this data type.
Length
4 bytes
Display size
11 digits. One digit is for the sign.
SQL_LONGVARBINARY
Precision
Same as the length.
Scale
Not applicable. SQLBindParameter ignores the value of ibScale for this data type.
Length
The maximum length. If a function cannot determine the maximum length, it returns SQL_NO_TOTAL.
Display size
The maximum length times 2. If a function cannot determine the maximum length, it returns SQL_NO_TOTAL.
SQL_LONGVARCHAR
Precision
Same as the length.
Scale
Not applicable. SQLBindParameter ignores the value of ibScale for this data type.
Length
The maximum length. If a function cannot determine the maximum length, it returns SQL_NO_TOTAL.
Display size
Same as the length.
SQL_REAL
Precision
7. SQLBindParameter ignores the value of cbColDef for this data type.
Scale
Not applicable. SQLBindParameter ignores the value of ibScale for this data type.
Length
4 bytes
Display size
13 digits. The digits are for a sign, 7 numeric characters, a decimal point, the letter E, another sign, and 2 more numeric characters.
SQL_SMALLINT
Precision
5. SQLBindParameter ignores the value of cbColDef for this data type.
Scale
0. SQLBindParameter ignores the value of ibScale for this data type.
Length
2 bytes
Display size
6 digits. One digit is for the sign.
SQL_TIMESTAMP
Precision
8. SQLBindParameter ignores the value of cbColDef for this data type.
Scale
The number of digits in the FRACTION field.
Length
16 bytes
Display size
19 or more digits:
  • If the scale of the time stamp is 0: 19 digits in the format yyyy-mm-dd hh:mm:ss.
  • If the scale of the time stamp exceeds 0: 20 digits plus digits for the FRACTION field in the format yyyy-mm-dd hh:mm:ss.f...
SQL_VARCHAR
Precision
Same as the length.
Scale
Not applicable. SQLBindParameter ignores the value of ibScale for this data type.
Length
The specified length. For example, the length of VARCHAR(10) is 10 bytes.
Display size
Same as the length.