Rejecting records that contain errors

When a JDBC Connector stage includes a reject link, records that meet specified criteria are automatically routed to the target stage on the reject link. Processing continues for the remaining records.

About this task

When you configure a reject link, you select one or more conditions that control when to reject a record and send it to the target stage that receives the rejected records. You can also choose to include the associated JDBC error code and error message with the rejected record. If you do not define a reject link or 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.

After you run the job, you can evaluate the rejected records and adjust the job and the data accordingly.

Procedure

  1. On the job design canvas, add and configure a target stage to receive the rejected records.
  2. Right-click the JDBC Connector stage icon and drag to create a link from the JDBC connector to it.
  3. If the link is the first link for the JDBC Connector stage, right-click the link and choose Convert to reject. If the JDBC Connector stage already has an input link, the new link automatically displays as a reject link.
  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 (downstream stage) list.
  6. Click the Reject tab.
  7. From the Reject rows based on selected conditions list, select the conditions under which you want the records from the input link to be sent to the reject link.
  8. Use one of the methods in the following table to specify when to stop a job because of too many rejected rows.
    Method Procedure
    Stop a job based on the percentage of rows that fail.
    1. From the Abort when list, select Percent.
    2. In the Abort after (%) field, enter the percentage of rejected rows that causes the job to stop.
    3. In the Start count after (rows) field, specify the number of input rows to process before calculating the percentage of rejected rows.
    Stop a job based on the number of rows that fail.
    1. From the Abort when list, select Rows.
    2. In the Abort after (rows) field, specify the maximum number of rejected rows to allow before the job stops.
  9. Optional: From the Add to reject row list, select ERRORCODE, ERRORTEXT, or both.
    The ERRORCODE and ERRORTEXT fields in each rejected record are set to the values that depend on the reject condition under which the record was rejected:
    Reject condition ERRORCODE value ERRORTEXT value
    SQL error Set to the error code provided by the driver. Set to a text message, which includes information that is provided by the driver about the error.
    Row not inserted 1 Set to a text message which indicates that zero rows were inserted for the current record.
    Row not updated 2 Set to a text message which indicates that zero rows were updated for the current record.
    Row not deleted 3 Set to a text message which indicates that zero rows were deleted from the current record.
  10. Click OK, and then save the job.