Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
billxu
Contributor
Contributor

Anyway to get results of each row in tDBOutput?

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?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

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

View solution in original post

3 Replies
Anonymous
Not applicable

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.

0695b00000dakTbAAI.png

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

 

 

billxu
Contributor
Contributor
Author

Hello Shong This is a solution for this case, but when working with millions of records, it is not an efficient way. I have checked code generated behind tDBOutput, there is a loop of counting number of succeeded rows (accurately an iteration of results array returned from executeBatch). I wonder that if there are any possibilities to retrieve the results array latter in tJava or tJavaRow? Best regards, Bill Xu 获取 Outlook for iOS<>
Anonymous
Not applicable

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