Data type scale (CLI) table
You can define the
scale of a numeric column or parameter. The scale of a numeric column
is the maximum number of digits to the right of the decimal point.
For
approximate floating point number columns or parameters, the scale
is undefined because the number of digits to the right of the decimal
place is not fixed.
The following table defines the scale for each SQL data type.
| fSqlType
|
Scale
|
|---|---|
| SQL_CHAR
SQL_VARCHAR SQL_LONGVARCHAR SQL_CLOB |
Not applicable. |
| SQL_DECIMAL
SQL_NUMERIC |
The defined number of digits to the right of the decimal place. For example, the scale of a column defined as NUMERIC(10, 3) is 3. |
| SQL_SMALLINT
SQL_INTEGER SQL_BIGINT |
0 |
| SQL_REAL
SQL_FLOAT SQL_DECFLOAT SQL_DOUBLE |
Not applicable.
|
| SQL_BINARY
SQL_VARBINARY SQL_LONGVARBINARY SQL_BLOB |
Not applicable.
|
| SQL_TYPE_DATE
SQL_TYPE_TIME |
Not applicable.
|
| SQL_TYPE_TIMESTAMP
|
The number of digits to the right of the decimal point in the "yyyy-mm-dd hh:mm:ss[.ffffffffffff]" format. For example, if the TIMESTAMP data type uses the "yyyy-mm-dd hh:mm:ss.fff" format, the scale is 3. |
| SQL_GRAPHIC
SQL_VARGRAPHIC SQL_LONGVARGRAPHIC SQL_DBCLOB |
Not applicable.
|
| SQL_WCHAR
SQL_WVARCHAR SQL_WLONGVARCHAR |
Not applicable.
|
| SQL_XML
|
Not applicable.
|