Whenever SAP Sybase IQ requires an explicit or
implicit conversion from one data type to another during a query or insert, it always
truncates the results.
- When you explicitly convert data from a higher scale to a lower
scale, SAP Sybase IQ truncates the values in the
results. For example, if you CAST a column value in a query to a
scale 2 when it is stored with a scale 4, values such as 2.4561 become 2.45.
- When SAP Sybase IQ implicitly
converts from a higher scale to a lower scale during an insertion, it truncates the
values before inserting the data into the table. For example, if you insert from one
table with a data type of NUMERIC(7,3) to another
table with a data type of DECIMAL(12,2), values
such as 2.456 become 2.45.
- When an arithmetic operation results in a higher scale than the
predetermined scale, SAP Sybase IQ truncates the
results to fit the scale
.
If your results require rounding of the values instead of truncation, use the
ROUND function in your command. However, for
inserts, the ROUND function can only be part of its
query expression.
The maximum precision for numeric data is 126.