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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Unable to get row counts

Hello All,
I've set up a job that does the following:
1) Query salesforce with a salesforce input component for all case records that match a certain criteria
2) Use an iterateToFlow to call another salesforce input component to get all the emailMessages related to each case
3) Insert those emails into a mysql database via a mysql output component
4) Delete the successful inserts from salesforce via a salesforce output component.
This job works correctly at the moment. What I need to add is a piece to update the case record with the number of emails put in the mysql database. My problem is that I cannot seem to get the row count of inserts for the mysql database. Unfortunately, nothing I have tried has allowed me to get the successful insert count of emails per case. Does anyone know how to get the row counts for the mysql insert per iterate successfully?
Labels (3)
5 Replies
Anonymous
Not applicable
Author

Hi
There is a global variable like ((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_INSERTED")) that counts the number of inserted records into target DB, press ctrl+bank space in any text field of a component, you will see a list of the global vriables are avaiable and select the one you want to use.
Shong
Anonymous
Not applicable
Author

I've attempted to use that value, but no matter what I do I am unable to get anything but null from it.
Anonymous
Not applicable
Author

Yes. Talend does not create code for this output variable if the output db component works in batch mode (or extended insert mode). Use the simple NB_LINE value instead: ((Integer)globalMap.get("tMysqlOutput_1_NB_LINE")).
BTW. it would be easy to provide an insert counter also in the batch mode because the executeBatch() method from the JDBC API returns an array with counts of changed dataset for EVERY single statement in the batch.
There is space for improvements a lot 😉
Anonymous
Not applicable
Author

Thanks for the replies. I've ended up using my own counter with global var and a Numeric.sequence call to get the row counts the way I need them.
Anonymous
Not applicable
Author

Feel free to Create a request for enhancement in JIRA.
Cheers,
Elisa