The functions that get and set precision, scale, length, and display size for SQL values have size limitations for their input arguments. Therefore, these values are limited to the size of an SDWORD that has a maximum value of 2,147,483,647. The following table describes these values.
The following table describes the precision, scale, length, and display size for the standard Informix ODBC Driver SQL data types.
Informix ODBC Driver SQL Data Type (fSqlType) | Description |
---|---|
SQL_BIGINT
(IDS) |
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
(IDS) |
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:
|
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. |
The following table describes the precision, scale, length, and display size for the Informix ODBC Driver SQL data types for Dynamic Server.
Informix ODBC Driver SQL Data Type (fSqlType) | Description |
---|---|
SQL_IFMX_UDT_BLOB |
Precision: Variable value. To determine this value, call a function that returns the precision for a column. Scale: Not applicable. A function that returns the scale for a column returns -1 for this data type. Length: Variable value. To determine this value, call a function that returns the length for a column. Display Size: Variable value. To determine this value, call a function that returns the display size for a column. |
SQL_IFMX_UDT_CLOB |
Precision: Variable value. To determine this value, call a function that returns the precision for a column. Scale: Not applicable. A function that returns the scale for a column returns -1 for this data type. Length: Variable value. To determine this value, call a function that returns the length for a column. Display Size: Variable value. To determine this value, call a function that returns the display size for a column. |
SQL_INFX_UDT_FIXED |
Precision: Variable value. To determine this value, call a function that returns the precision for a column. Scale: Not applicable. A function that returns the scale for a column returns -1 for this data type. Length: Variable value. To determine this value, call a function that returns the length for a column. Display Size: Variable value. To determine this value, call a function that returns the display size for a column. |
SQL_INFX_UDT_VARYING |
Precision: Variable value. To determine this value, call a function that returns the precision for a column. Scale: Not applicable. A function that returns the scale for a column returns -1 for this data type. Length: Variable value. To determine this value, call a function that returns the length for a column. Display Size: Variable value. To determine this value, call a function that returns the display size for a column. |