Update Old Records And Insert New Records In IICS
In order to insert new records as well as update the existing records onto the targe table, set “upset” option in target properties- Once the task is run with this property set, it will insert the new records as well as update the existing records.
Procedure:-
- Login to IICS and create a new mapping and save it.
Source :- In the source transformation, select the employee_src.txt as the source object. Under Formatting Options, select the delimiter and other flat file related properties. Verify if the source fields are properly read under Fields section.
Target :-
- Pass the data from source to a target transformation. Select the dimension table TGT_EMP_INS_UPDATE as target object with operation defined as “upset”(both insert and update option).
- If key constraints are not assigned to the target table, select the field in the update column.
- To updated and insert records the target should be a relational table.
- Save the Mapping and then create the Mapping task and run the mapping.
Input and Output :-
First Run:-
Source :- Source file before updating old and inserting new data.
Target :- Target table before updating and inserting new data.
Second Run :-
Source :- Source file after updating old and inserting new data.
Target :- Target table after updating and inserting new data.