i have a requirement, where i need to insert records, delete and update operations based on few columns. We get data in csv format like shown below.
UserId, userEmail, Name, delete
1,"email@example.com", "Dummy", "Y"
2."firstname.lastname@example.org", "lName", "N"
1. Need to insert operation on target table if user id is not present.
2. Need to update on target table if user id present and delete ="N".
3. Need to delete on target table if user id present and delete ="Y"
I am not sure whether we can achieve this with db2 import. Could someone help me ?
INGEST with MERGE should help you.
If you are not able to use INGEST, you can use IMPORT, but you have to implement the UPDATE/DELETE logic with an AFTER UPDATE trigger on your table or create a view with an INSTEAD OF UPDATE trigger on it and use this view in your IMPORT command.