Are you shure the duplicate is not in your staging table?
sel COUNTRY_ISO_A2 ,CITY_TXT ,ZIP_CODE
from staging
group by 1
having count(*) > 1
And to find out which rows might cause that error:
sel COUNTRY_ISO_A2 ,CITY_TXT ,ZIP_CODE from staging
intersect
sel COUNTRY_ISO_A2 ,CITY_TXT ,ZIP_CODE from target
If those queries don't return any rows, it might be due to some rules for comparing strings in UTF?
To find out which rows caused the error you could create a copy of the target table with a UPI on those columns, do a CREATE ERROR TABLE and then use a MERGE or INS/SEL with LOGGING ALL ERRORS. Thus there's no unspecific "a row caused an error", but the rows are recorded within the error table.
Dieter
Are you shure the duplicate is not in your staging table?
And to find out which rows might cause that error:
If those queries don't return any rows, it might be due to some rules for comparing strings in UTF?
To find out which rows caused the error you could create a copy of the target table with a UPI on those columns, do a CREATE ERROR TABLE and then use a MERGE or INS/SEL with LOGGING ALL ERRORS. Thus there's no unspecific "a row caused an error", but the rows are recorded within the error table.
Dieter