Optimize update statement
Hi All,
how can I optimize the below update statement?
declare
cursor c_temp_item_loc_soh is
select TILS.ITEM,
TILS.LOC_TYPE,
TILS.LOC,
TILS.FIRST_SOLD,
TILS.LAST_SOLD,
TILS.FIRST_RECEIVED,
TILS.LAST_RECEIVED
from temp_item_loc_soh tils
where exists ( select 1
from item_loc_soh ils
where ils.item = tils.item
);
cpt integer := 0;
begin
for rec_temp_item_loc_soh in c_temp_item_loc_soh
loop
if rec_temp_item_loc_soh.loc_type = 'S' then
update item_loc_soh
set first_sold = to_date(rec_temp_item_loc_soh.first_sold,'YYYYMMDD'),
how can I optimize the below update statement?
declare
cursor c_temp_item_loc_soh is
select TILS.ITEM,
TILS.LOC_TYPE,
TILS.LOC,
TILS.FIRST_SOLD,
TILS.LAST_SOLD,
TILS.FIRST_RECEIVED,
TILS.LAST_RECEIVED
from temp_item_loc_soh tils
where exists ( select 1
from item_loc_soh ils
where ils.item = tils.item
);
cpt integer := 0;
begin
for rec_temp_item_loc_soh in c_temp_item_loc_soh
loop
if rec_temp_item_loc_soh.loc_type = 'S' then
update item_loc_soh
set first_sold = to_date(rec_temp_item_loc_soh.first_sold,'YYYYMMDD'),
0