We are using IBM Infosphere CDC for replicating data from Source to target. We have a query in using this tool, i.e. is there any way or option to insert a new row into the target table instead of just overwriting the change.
For e.g:
1. Lets suppose that emp1 and emp2 are the source and target tables.
2. These have columns eno, ename.
3. On first replication process, all the data is moved to target.
4. Now, the data in the existing records is modified like ename is modified from "abc" to "def" in an existing record.
5. When we again run the replication process, the record is getting overwritten with "def" in the target table.
Our requirement is such that a new record should be inserted in the target table with the changes, instead of overwriting the existing record.
Any help or pointers on this would be highly appreciated.
Your question may be more a factor of the databases and tables involved than it is a factor of CDC. If I correctly understand what you are asking the first question I have to ask you is do you have a primary key on the target that is forcing an update on any existing row for which you have a unique primary key that matches? If you have keys on both source and target then the only way the target database can respond is to update the row because of a key match. If you do not have a key on the target then the updated record from the source would be inserted into the target every time and this could result in duplicate data rows in the target. I hope this makes sense.
In MC in the table mappings (available via subscription configuration) there is a tab called "Operation".
There you can specify the Row-level operation for a table. In your case you can specify to "Insert Row" for the "On Update" operation.