Scale of SQL data types
The scale of a numeric column or parameter refers to 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 |
---|---|
|
Not applicable. |
|
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. |
|
0 |
SQL_DECFLOAT | Not applicable. |
|
Not applicable. |
SQL_ROWID | Not applicable. |
|
Not applicable. |
|
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. The
maximum for fractional seconds is 12 digits. You can retrieve
the scale through the pibScale argument of SQLDescribeCol() . |
SQL_TYPE_TIMESTAMP_WITH_TIMEZONE | The number of fractional digits to the right of the decimal point in the "yyyy-mm-dd hh:mm:ss.ff+hh:mm" or "yyyy-mm-dd-hh.mm.ss.ff+hh:mm" format. For example, if the TIMESTAMP WITH TIME ZONE data type uses the "yyyy-mm-dd hh:mm:ss.ff+hh:mm" format, the scale is 2. The maximum for fractional seconds is 12 digits. You can retrieve the scale through the pibScale argument of SQLDescribeCol(). |
|
Not applicable. |
SQL_XML | 0 |