Subject Re: [ib-support] arithmetic exception, numeric overflow and string truncation
Author Helen Borrie
At 03:58 PM 15/04/2003 +0800, you wrote:
>Hi
>
>i am getting the following exception when i execute the following UPDATE
>statement
>
>Update IVITEMLOC
>set QTYONHAND=QTYONHAND+-23.0,
>averagecost = (((23.00000000) +(qtyonhand * averagecost)) / (23.0+ qtyonhand))
>where ivitemid ='RBDPOLN' and ivlocid =1
>;
>
>
>Statement failed, SQLCODE = -802
>
>arithmetic exception, numeric overflow, or string truncation
>
>but when i remove the "QTYONHAND in the update then i have no problem. can
>any body tell me what is the problem that causing the first query.
>
>Update IVITEMLOC
>set averagecost = (((23.00000000) +(qtyonhand * averagecost)) / (23.0+
>qtyonhand))
>where ivitemid ='RBDPOLN' and ivlocid =1

You don't say what data types you are using but my guess is that you are
getting the middle one - numeric overflow - by having two many places of
precision in your output values.

heLen