Archives of the TeradataForum
Message Posted: Mon, 06 Jan 2003 @ 16:42:37 GMT
Multiplying two dec(15,2) fields would generate a dec(18,4) field.
The quick test would be something like:
SELECT CAST(100.00 AS DECIMAL(15,2)) * CAST(100.00 AS DECIMAL(15,2)) AS C1 , TYPE(C1)
C1 Type(C1) 10,000.0000 DECIMAL(18,4)
The rule tends to be to add the two precision values together, with a maximum value of 18, and use this as the target precision value. The two scale values are also added together, to form the target scale value, if the target scale value is greater than 18, then a "2614: Precision loss during expression evaluation" error is generated.
For example DEC(5,2) * DEC(5,2) = DEC(10,4)
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|