Ah, just thought of another possibility. You could use the external table method and query it with an analytic function that would indicate whether the row was a duplicate of another in the file ... for example if the pk columns were PK1 and PK2 then you could query with ...
... and use a multi-table insert to either ...Code:Select Row_Number () Over (Partition By PK1, PK2) PK_Occurance, Count() Over (Partition By PK1, PK2) PK_Count, PK1, PK2, ... From my_external_table
i) Insert all rows contributing to a PK violation into an error table, or ...
ii) Insert all-but-one rows contributing to a PK violation into an error table
... by using a WHEN clause based on PK_Occurance or PK_Count in the above query.
Well, I think it would work.




Reply With Quote