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