merge into table_b b
using (SELECT t.customcode from table_a a) temp
on (a.customcode = temp.customcode)
when matched then
update set a.name = temp.name
FOR a IN (SELECT t.customcode from table_a) LOOP
update table_b b
SET b.CUSTOMNAME = a.CUSTOMNAME
WHERE a.CUSTOMCODE = b.CUSTOMCODE;
END LOOP;