Five Stars

Fail the job when no rows returned

Hi,

I'm new to Talend.

I'm looking to create job where it exits (or fails with return code 1) when no rows are returned and succeeds if there's data in source table.

I tried a couple of approaches but they're not working. appreciate if someone can help me.

 

 

 

1 REPLY
Community Manager

Re: Fail the job when no rows returned

Hi

You can use a tDie to die the job and customize the error message and error code. eg;

tMysqlInput--main--tJavaRow

   -runIf--tDie

Set the condition of runIf as:

((Integer)globalMap.get("tMysqlInput_1_NB_LINE"))==0

 

Regards

Shong

 

----------------------------------------------------------
Talend | Data Agility for Modern Business