Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

rejected rows capture

Hi, I am New to talend.. please anyone help me on this scenario
- I have a job to transfer data from source table to target table and Iam using some talend input and output database components for example tMySqlInput and tMySqloutput. Iam interested in finding the rejected rows which are not processed by tMySqloutput component..
and how to transfer the data One by one record..

Thanks In advance
ranreddy
Labels (3)
14 Replies
Anonymous
Not applicable

Hi
The reject row can't be used together with the 'die on error' option and 'extend insert' option in advanced setting tab of tMysqlOutput component, uncheck these two option and then you can use the reject row. Right click on tMysqlOutput, select Row, and then Reject.
_AnonymousUser
Specialist III
Specialist III
Author

hi shong
thanks for ur rply..
How to send a mail these rejected record information.



Thanks,
ranreddy
Anonymous
Not applicable

hi shong
thanks for ur rply..
How to send a mail these rejected record information.
Thanks,
ranreddy

To send a mail, you can use tSendMail component. You can output all the reject rows in a file and attach it in the mail or sent all the reject rows in the body part of the mail.
_AnonymousUser
Specialist III
Specialist III
Author

Thanks for ur help shong.
I am facing the problem here only, how to attach the record's all information in a file?



Thanks
Ranreddy
Anonymous
Not applicable

As you already connected your flow to the output database component do it in the same way to drag the reject output flow from your output database component to a tFileOutputDelimited component. In the file component you should consider to set the option Add Header and choose a proper field delimiter and of course you have to choose the full file path.
It could be helpful to put an tMap between your last flow, because the reject output flow contains two additional field which contains the error message and the stacktrace. That can disturb your file structure.
In the tMap you can consider to not connecting this both special columns to the file output flow.
_AnonymousUser
Specialist III
Specialist III
Author

Thanks for your reply mr.Jlolling,


Is there any possible to send a mail with rejected records information like email content, i mean not like attached file?


Thanks,
Ranreddy
Anonymous
Not applicable

Hi
Yes, you can send all the reject records in the email body. Link a reject flow from tMysqlOutput to a tJavaFlex, collect and concatenate all the reject records. for example:
tMysqlInput--(row1)main--tMysqlOutput--(row2)reject--tJavaFlex
|
onsubjobok
|
tSendMail
at the begin part of tJavaFlex, defing a string, eg:
String reject_record="";
at the main part of tJavaFlex,
s=s+row1.column1+";"+"row1.column2"+"\n";
at the end part of tJavaFlex, put the string to a list. eg:
globalMap.put("mykey",reject_records);
In the body part of tSendMail, get all the reject records from the list, for example:
"The reject records are:"+"\n"+(String)globalMap.get("mykey")
Shong
Anonymous
Not applicable

Hi i am new too, how can i know, how many records were rejects.
tks
sssalvatierra
Anonymous
Not applicable

Nearly all flow processing components provides a return value called NB_LINE. You can find them in the Outline view.
If you want only count the rejected rows you could use the tJavaRow component. This component does nothing if you do not add your own Java code but it counts the lines.