update tab1 set (a,b,c) = (select a,b,c from tab2 where tab1.pk = tab2.pk) where exists (select a,b,c from tab2 where tab1.pk = tab2.pk)
INSERT into tab1(a,b,c) (select a,b,c from tab2 where not exists (select 1 from tab1 where tab1.pk = tab2.pk))
Are 2 SQL statements, not 1
I thought with
If i load the input data in a table , it is possible to write a sql such that it insert and update the output table as per the select query return code
you meant loading the flat file in an empty table2
and then based on table2, insert/update table1
I can explain it to you, but i can not understand it for you.