Using IBM Informix Dynamic Server Version 10.00.FC9
The error I’m getting is:
1226: Decimal or money value exceeds maximum precision.
Normally, this makes perfect sense and I can fix the precision via CAST, but everything I try is still producing the same error.
I have three columns that I initially set to a constant of 0.00. After a few statements, I have updated two of these columns to positive decimals keeping the same precision.
When I try to multiply these two columns together to update the third column, I get the error above.
My update statement is: UPDATE table SET col_3 = col_1*col_2;
I’ve tried several things, but have had no luck in avoiding that error.
I tried setting the constant in col_3 to 0.000000.
I also tried updating using CAST on both the two sides of the multiplication and the final value:
UPDATE table SET col_3 = CAST((col_1) AS DECIMAL(6,2))*CAST((col_2) AS DECIMAL(6,2));
UPDATE table SET col_3 = CAST((col_1*col_2) AS DECIMAL(6,2));
Any combination of these attempts always results in the same error.
Does anyone know what I’m missing here or doing wrong?
I needed to set the constant to
12.00I was missing the two places before the decimal