The exact numeric types—dec, decimal, and numeric—begin with an optional positive or negative sign and can include a decimal point.The value of exact numeric data depends on the column’s decimal precision and scale.
datatype [(precision [, scale ])]
The precision specifies the maximum number of decimal digits that can be stored in the column. It includes all digits to the right and left of the decimal point. You can specify a precision ranging from 1 to 38 digits, or use the default precision of 18 digits.
The scale specifies the maximum number of digits that can be stored to the right of the decimal point. The scale must be less than or equal to the precision. You can specify a scale ranging from 0 to 38 digits, or use the default scale of 0 digits.
If a value exceeds the column’s precision or scale, SAP ASE flags the entry as an error. Here are some examples of valid dec and numeric data:
Data entered |
Datatype |
Precision |
Scale |
Value |
---|---|---|---|---|
12.345 |
numeric(5,3) |
5 |
3 |
12.345 |
-1234.567 |
dec(8,4) |
8 |
4 |
-1234.567 |
The following entries result in errors because they exceed the column’s precision or scale: