merge into TB_APP a
using ( select * from TB_TEMP ) t
on ( a.PK_COL1 = t.PK_COL1
and a.PK_COL2 = t.PK_COL2 -- ie, primary key columns
and ...
)
when matched then
update set
a.COL1 = t.COL1,
a.COL2 = t.COL2,
...
a.FIELDS_MODIFIED =
decode(a.COL1,t.COL1,'','col1,')||
decode(a.COL1,t.COL2,'','col2,')||
decode(a.COL1,t.COL3,'','col3,')||
decode(a.COL1,t.COL4,'','col4,')
...
where decode(t.COL1,a.COL1,1,0) = 0
or decode(t.COL2,a.COL2,1,0) = 0
or decode(t.COL3,a.COL3,1,0) = 0
or decode(t.COL4,a.COL4,1,0) = 0
or decode(t.COL5,a.COL5,1,0) = 0
...