Cannot update data on a table
I have loaded some data in a temp table . Then I have written a script to update data from temp to main table. But i am getting an error invalid number.
Data type in temp table is varchar
Data type in main table is number
begin
FOR C IN (select ITEM_CODE ,FJAN ,FFEB ,FMAR ,FAPR ,FMAY ,FJUN ,FJUL ,FAUG ,FSEP,FOCT ,FNOV ,FDEC from grays_sales_forecasts_temp)
LOOP
update grays_sales_forecasts_t
set FDEC = to_number(c.FDEC)
where ITEM_CODE = C.ITEM_CODE;
END LOOP;
end ;
Could anyone help.
BTW I hav been able to update the other fields except for FDEC.
Data type in temp table is varchar
Data type in main table is number
begin
FOR C IN (select ITEM_CODE ,FJAN ,FFEB ,FMAR ,FAPR ,FMAY ,FJUN ,FJUL ,FAUG ,FSEP,FOCT ,FNOV ,FDEC from grays_sales_forecasts_temp)
LOOP
update grays_sales_forecasts_t
set FDEC = to_number(c.FDEC)
where ITEM_CODE = C.ITEM_CODE;
END LOOP;
end ;
Could anyone help.
BTW I hav been able to update the other fields except for FDEC.
0