How to capture Db2 datbase rejected records
Moderators: chulett, rschirm, roy
How to capture Db2 datbase rejected records
Hi
I am new to datastage and i am trying to do a datastage job in which there can be rejects from Db2 database if i try to insert the same key records.
SeqFile -->Transformer -->Db2 stage
---------------Rejected(from transformer)
in my transformer i don't have any thing defined for the constraint, so DS thinks that all the records are success all the time, but in reality there are some rejected records from Db2. How can i get these records and wriite to a file.
Any help would be greatly appreciated.
I am new to datastage and i am trying to do a datastage job in which there can be rejects from Db2 database if i try to insert the same key records.
SeqFile -->Transformer -->Db2 stage
---------------Rejected(from transformer)
in my transformer i don't have any thing defined for the constraint, so DS thinks that all the records are success all the time, but in reality there are some rejected records from Db2. How can i get these records and wriite to a file.
Any help would be greatly appreciated.
Hari
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Mark the second output link from the Transformer stage as "Rejects". This is a check box in the constraints editor. Leave the constraint expression for this link blank. The mere fact that it's marked as "Rejects" will cause it to capture database rejects from the first output link.
You also have access to stage variables from the first output link, such as DBMSCODE and LASTERR, that can aid diagnosing the cause of any rejected rows.
You also have access to stage variables from the first output link, such as DBMSCODE and LASTERR, that can aid diagnosing the cause of any rejected rows.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi
I am using DB2 API Stage and 'insert rows without clearing' action.
Just wanted to make sure i am briefing the procedure what i have done.
Ihave sequencial file,transformer, Db2 API and Reject file from tranformer stage.Read records from File(separated by pipe) and in the transformer i don't have any constraints defined for DB2 stage and [Rejected] for Rejected file stage.
I am using DB2 API Stage and 'insert rows without clearing' action.
Just wanted to make sure i am briefing the procedure what i have done.
Ihave sequencial file,transformer, Db2 API and Reject file from tranformer stage.Read records from File(separated by pipe) and in the transformer i don't have any constraints defined for DB2 stage and [Rejected] for Rejected file stage.
Hari
Ah... it does need to be 1 to capture them reliably, however it seems like it should still have 'worked' after a fashion when it is set higher. From what I recall, Oracle would report the right number but put the wrong record in the reject file. It also depended on if your total row count exceeded the array size or not, IIRC.
There should be a post in here from me on the subject from five years or so ago.
There should be a post in here from me on the subject from five years or so ago.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers