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?
6 REPLIES
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
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
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
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
One Star

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

tMssqlOutput--Reject-->tLogRow--Output-->tFlowToIterate--Iterate-->tDie ?
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