how to compare data in 2 identical table?
Up to DB2how to compare data in 2 identical table?
Posted by abcd at September 14. 2010Hello All,
i have 2 identical tables tables in LUW database and host server ,
and i did a federation setup between LUW database and HOST db
now i have compared the data between these 2 tables and updated columns using below commands.
select *from s1.TLPRZUL_BEDG where BEDG_NR NOT IN (select BEDG_NR from s1.TLPRZUL_BEDG_tst) order by BEDG_NR;
select *from s1.TLPRZUL_BEDG_tst where BEDG_NR NOT IN (select BEDG_NR from s1.TLPRZUL_BEDG) order by BEDG_NR;
select *from s1.TLPRZUL_BEDG A JOIN
s1.TLPRZUL_BEDG B ON
A.BEDG_NR=B.BEDG_NR where
A.MANDANT_NR <> B.MANDANT_NR or
A.OBJEKT_VERSION <> B.OBJEKT_VERSION or
A.BEDG_KURZBEZ <> B.BEDG_KURZBEZ or
A.BEDG_NAME <> B.BEDG_NAME or
A.BEDG_BESCHRBG <> B.BEDG_BESCHRBG or
A.F_ONLINE_NAME <> B.F_ONLINE_NAME or
A.REIHENFOLGE <> B.REIHENFOLGE or
A.BEDG_ART_NR <> B.BEDG_ART_NR or
A.BEDG_DLCBEZ <> B.BEDG_DLCBEZ or
A.SELEKTIONSNR <> B.SELEKTIONSNR or
A.KZ_INHALTSVERZ <> B.KZ_INHALTSVERZ;
is there any way to do these 3 steps using syscatlog tables for a given 2 tables?? or any short script to do this comparision?
Now i am looking for compare this kind of scenario using syscatlog tables dynamically with out hard coding the column names for a given 2 identical table.
Regards