摘要 |
<p>A method and a system for importing data into a table (2, 6) with constraints consistency analysis and customized merge parameters are disclosed, comprising:
- providing the table (2, 6) comprising data identities (VAL_1, VAL_2, VAL_91, CH_1, CH_2, CH_3) and a primary key (PK) assigned to each of the data identities (VAL_1, VAL_2, VAL_91, CH_1, CH_2, CH_3);
- providing a temporary copy (4, 8) of this table (2, 6) comprising at least one data identity (VAL_2, CH_3) to be merged into the table (2, 6);
- determining the table structure of the table (2, 6) and the table structure of the temporary copy (4, 8) and comparing the determined table structure to the table structure of the temporary copy in order to decide which data identities have to be updated in the table only and which data identities have to be imported;
- creating in the temporary copy a new column (PK_NEW) comprising a final primary key of the related data identity for its transfer into the table (2, 6), thereby assigning the same primary key to the data identity (VAL_1, CH_1, CH_2) in the temporary copy (4, 8) if the data exists already in the table (2, 6) and assigning a new primary key to the data identity (VAL_2, CH_3) in the temporary copy (4, 8) if the data identity is not present yet in the table (2, 6);
- locking the data identities in the table (2, 6) that are present in the temporary copy (4, 6) and executing an update function for the data identities (VAL_1, CH_1, CH_2) having the same primary key in both the table (2, 6) and the temporary copy (4, 8) and executing an import function for the data identities (VAL_2, CH_3) having a newly assigned primary key comprised in the new column (PK_NEW) of the temporary copy (4, 8); and
- unlocking the locked data identities after the successful execution of the updating and the importing function.</p> |