I have searched and read all articles related to this, even the Leakage article and still I can't find an example on how to capture rejects due to duplicate entries.
As I am still learning the product, I can't find any good examples on how to set this rejectlogic up. I create a test job where I read from one DB2 Table and try to insert it into another that contain the same records. This will cause a duplicate. I used the tranformer stage but I am not sure what I need to do. Is there a constraint I must add or something. I am not sure if I am suppose to capture the SQLSTATE = 23505... etc. I agrre that there is alot of posts on this but none really clearly state how to accomplish this problem.
Could someone please shed some more light on this. Maybe it will decrease the amount of posts that have been written on the subject.
Thanks.
DB2/UDB API Reject Link
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In parallel jobs it's not done in the Transformer stage. DB2 rejects are captured by a reject link on the DB2 stage.
However, better practice is to detect the duplicates upstream. The easiest way is a Sort stage that generates a Key Change column. The second easiest way is to use stage variables in a Transformer stage.
However, better practice is to detect the duplicates upstream. The easiest way is a Sort stage that generates a Key Change column. The second easiest way is to use stage variables in a Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: