How to stop job after the first rejected row?

Highlighted
One Star

How to stop job after the first rejected row?

Hello,
I've a job that I need it to stop as soon as the first reject row appears, no matter what. The first subjob insert the record in the master table and the second (execute through onSubJobOk) inserts the details of the master table.
See the attached image to details. When I execute the job all the MSSQL are hit, even when the first one have reject row. I need a way to stop the execution when any of the 4 reject log happens, how could I do this?
Highlighted
Community Manager

Re: How to stop job after the first rejected row?

Hello
Check the option "Die on error " on tMsSqlOutput.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Highlighted
One Star

Re: How to stop job after the first rejected row?

Is it possible to choose an error code when I use "Die on error"?
I need to specify the error code, because the calling process rely on it.
Regards,
Felipe Cypriano
Highlighted
Community Manager

Re: How to stop job after the first rejected row?

Hello
Add a tDie component after tMssqlOutput, eg;
tMssqlOutput--onComponentError--tDie
On tDie, you can define the error message and error code.
and put a tlogcatcher in a job to catch the tDie message and error code.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Highlighted
One Star

Re: How to stop job after the first rejected row?

Just one more question, and I think this will be the last one. Is it possible to use tDie and tLogRow together in this case?
For example, I want to print the data from the rejected row (tLogRow) and to send a user specified error code using tDie.

Thanks, shong, for your support,
Felipe Cypriano
Highlighted
One Star

Re: How to stop job after the first rejected row?

tMssqlOutput--Reject-->tLogRow--Output-->tFlowToIterate--Iterate-->tDie ?
Highlighted
One Star

Re: How to stop job after the first rejected row?

Hi All,

I am trying to reverse of that.
I want to rerun the copying table automatically after any kind of error message (Input and output both side).
Is it possible?
Kindly reply me.

THanks,
Niket

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog