rejected rows capture

One Star

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
Community Manager

Re: rejected rows capture

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.
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: rejected rows capture

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



Thanks,
ranreddy
Community Manager

Re: rejected rows capture

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.
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: rejected rows capture

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
Seventeen Stars

Re: rejected rows capture

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.
One Star

Re: rejected rows capture

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
Community Manager

Re: rejected rows capture

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
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: rejected rows capture

Hi i am new too, how can i know, how many records were rejects.
tks
sssalvatierra
Seventeen Stars

Re: rejected rows capture

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.
One Star

Re: rejected rows capture

I have rejects set up to redirect bad data to an excel file. I have checked the option don't generate empty file clicked. My job is still creating an empty file. Please help what should i do to avoid this thank you
Thank You
Four Stars

Re: rejected rows capture

Hi, How to create a joblet for this, in my project i have 200 jobs .
One Star

Re: rejected rows capture

I'm writing all the rejected data to a  file and how do i need to send a mail of the that output file. Please help
One Star

Re: rejected rows capture

tSendMail with file attachment
One Star

Re: rejected rows capture

Can you please help on how to get the count of records using NB_LINE. Please explain how to use it.