Question:
Input-1:
1
2
3
4
5
6
Input-2:
4
5
6
7
8
9
Output-1:
1
2
3
Output-2:
4
5
6
Output-3:
7
8
9
Input-1:
1
2
3
4
5
6
Input-2:
4
5
6
7
8
9
Output-1:
1
2
3
Output-2:
4
5
6
Output-3:
7
8
9
Solution:
This problem can be solved by using no of ways like JOIN stage with OUTER JOIN,Lookup stage and CDC stage.
In this solution, I will use Change Data Capture (CDC) stage.
Final job design would be like this:
This problem can be solved by using no of ways like JOIN stage with OUTER JOIN,Lookup stage and CDC stage.
In this solution, I will use Change Data Capture (CDC) stage.
Final job design would be like this:
My first input set records that has the records from 1 to 6.
My second input set records that has the records from 4 to 9.
Edit the CDC stage properties exactly like below.
Key = Key Column Name ( I have given column name as Key)
As we aware CDC stage expects before and after datasets, select the before and after datasets appropriately.
Just map the change_code and Key column to the output.
Change code =0 means Copy records
Change code =1 means Insert records
Change code =2 means Delete records
Put a constraint according to the change code values in transformer stage.
Compile and run the job.
Here are the three outputs:
Hi
i have used below codes, i am getting 6 records only
Change code =0 means Copy records
Change code =1 means Insert records
Change code =2 means Delete records
What do you mean by 6 records only? 6 records as output from CDC stage?
If that is the case, you might have missed giving ‘sort order’ for the change key. Please check again.
now working fine i have updated change cap link order
Okay.