Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am using Talend job to delete data from table against its history data, and want to get the results of each row passed to tDBOutput.
The process flow is below:
tDBInput (get data from history) -> tDBOutput (delete data in target table) -> tLogRow (print data that has no matching data in target table)
I have put some history data for test, in which there are some records that has no matching data in target table.
But all of the rows are printed out in tLogRow. Is there any way to know whether a row has been successfully deleted or not in tDBOutput?
@Bill Xu I understand, I think this is the only way to get records that are deleted with existing component and get the total number of succeeded rows.
Hi
Get data from history and do an inner join with all records of target table on tMap, define two output, one for the matched records for delete, another one for the unmatched records. eg:
tDBInput1--main--tMap--out1---tDBOutput1
************************| --out2--tFileOutputDelimited1
************************* |lookup
********************** tDBInput2
Set the 'Catch the lookup inner join reject' option as true to catch the unmatched records in out2 table.
There is a global variable that store the total number of deleted records.
((Integer)globalMap.get("tDBOutput_1_NB_LINE_DELETED"))
You can use this global variable directly on next subjob if needed.
Regards
Shong
@Bill Xu I understand, I think this is the only way to get records that are deleted with existing component and get the total number of succeeded rows.