I need help!!
part of my function is this:
UPDATE temp_weekly_deliveries
SET sum = (
SELECT sum(drd_quantity)
FROM vw_dr_detail
WHERE drdprodcustid=drd_prod_cust_id and sonumber=so_number and dr_date between fromdate and todate
);
UPDATE temp_weekly_deliveries
SET totalsales = (
SELECT sum(sum * sodunitprice)
FROM temp_weekly_deliveries b
WHERE temp_weekly_deliveries.drdprodcustid=b.drdprodcustid and temp_weekly_deliveries.drsinum=b.drsinum
);
The error occurs during the second update because when I exclude the second update query the functions runs. The problem is I also need to update totalsales. totalsales and sum are both of type numeric(9,4). Is there really an overflow?
This is the error..:
pg_exec() query failed: ERROR: overflow on numeric ABS(value) >= 105 for field with precision 9 scale 4
can somebody please help me..
TIA