Page 1 of 1

Reject file for Oracle connector in write method

Posted: Thu Feb 26, 2015 11:59 am
by sharmabhavesh
Hi,
I want to load some data into a Oracle table using oracle connector (in append mode). My job fails if there's some issue with the data load (like primary key violation, NULL value for not-NULL fields etc).
I want the job to continue and insert whatever it can and reject records which can't be inserted to a reject file.
Is this feasible in Datastage.


P.S. I found one logging property in Oracle connector. But that says 'Log column values on first row error'. Does this mean only the first row which encountered insert error will be logged, other rows can't be logged. If 10 out of 100 rows are rejected, will only 1st row be logged, not other 9 rows?

Posted: Thu Feb 26, 2015 12:03 pm
by sharmabhavesh
Also, I am using a normal load (write mode) and not a bulk load.

Posted: Thu Feb 26, 2015 12:44 pm
by chulett
Have you tried setting up a reject link from the connector?

Posted: Thu Feb 26, 2015 1:07 pm
by sharmabhavesh
Yes Chulett, I set up a reject link as well. But the job is aborting for unsuccessful load and is not sending anything to the reject. Tried with different properties as well. Is there some specific property which needs to be set up?

Posted: Thu Feb 26, 2015 5:08 pm
by qt_ky
These quoted suggestions are from the product documentation / online help:
... if you define a reject link but a failed record does not match any of the specified reject conditions, the connector reports an error and stops the job
and
...

4. Double-click the connector to open the stage editor.

5. On the Output page, select the link to the target stage for rejected records from the Output name list.

6. Click the Reject tab.

7. From the Reject rows based on selected conditions list, select one or more conditions to use to reject records.

8. Use one of the methods in the following table to specify when to stop a job because of too many rejected rows.

...

9. Optional: From the Add to reject row list, select ERRORCODE, ERRORMESSAGE, or both. When a record fails, the rejected record includes the Oracle error code and the corresponding message that describes the failure. For a complete list of the Oracle error codes and messages, see the Oracle documentation.