Reject file for Oracle connector in write method

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

Reject file for Oracle connector in write method

Post 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?
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

Post by sharmabhavesh »

Also, I am using a normal load (write mode) and not a bulk load.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Have you tried setting up a reject link from the connector?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

Post 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?
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post 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.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply