Capturing individual rejects and errors
Many database applications require a log of rejects and errors to be kept to enable erroneous records to be identified, so that manual repairs can take place. This recipe shows how to capture errors for individual rows using the reject row facility.
Getting ready
Open the job jo_cook_ch07_0090_rejectsAndErrors
.
How to do it…
The steps to be performed are as follows:
Copy the
customer
table from metadata and create atMysqlOutput
component.Change the Table to
"customer_reject_test"
, and change Action on table to Drop table if exists and create.Right-click the
tMysqlOutput
component and you will see that the only Row option is Main.Run the job. You will see that there are errors in the console and that the table is empty.
Open
tMysqlOutput
, and click onAdvanced
settings.Uncheck Extend Insert.
Right-click on the
tMysqlOutput
component and you will now see a flow labeled Rejects.Send this flow to a
tLogRow
component which has Mode set to Vertical.Run the job...