Hi, I am trying to update a field, in rows, in an existing table, with the contents of a field from another table, and can't get past this error.. ora-01407: cannot update ("GEMMS"."CM_CMPT_DTL"."CMPNT_COST") to NULL.
This is the SQL:
This is the data in the tables:
cm_cmpt_dtl
ITEM_ID WHSE_CODE CALENDAR_CODE PERIOD_CODE COST_MTHD_CODE CMPNT_COST
6 858 2008 7 MKT 21.12
nt_cmpt_upd
ITEM_ID WHSE_CODE CMPNT_COST
6 918 19.632
9 918 13.68
10 918 15.215834
11 918 21.423639
15 918 6.0650805
Any ideas where I am going wrong...??
Thanks,
Les
This is the SQL:
Code:
update cm_cmpt_dtl a
set a.cmpnt_cost =
(select b.cmpnt_cost
from nt_cmpt_upd b
where a.item_id = b.item_id
and a.item_id = 6
and a.cost_mthd_code = 'MKT'
and a.whse_code = '918'
and a.calendar_code = '2008'
and a.period_code = 7)
cm_cmpt_dtl
ITEM_ID WHSE_CODE CALENDAR_CODE PERIOD_CODE COST_MTHD_CODE CMPNT_COST
6 858 2008 7 MKT 21.12
nt_cmpt_upd
ITEM_ID WHSE_CODE CMPNT_COST
6 918 19.632
9 918 13.68
10 918 15.215834
11 918 21.423639
15 918 6.0650805
Any ideas where I am going wrong...??
Thanks,
Les