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

How to execute on every 100 rows of data from DB?

Hi,

 

I am pretty sure talend should be able to do this task relatively easily, but I am not sure the best way to go about it. I have 100,000 rows of data, but an tSOAP I am calling can only take 100 rows of data per tSOAP call. I would like to execute an tSOAP call on 100 rows each time until I have looped through the full 100,000 row data set. Any advice/recommended components on going about this is much appreciated. 

 

Thanks,

Pratap.

Labels (2)
14 Replies
Anonymous
Not applicable
Author

Could you please let us know that how we can loop from DB instead of tFileInputDelimited (pointing at your file just to count the records)
elkhounds
Creator
Creator

I have a similar use case, except I need to execute (or Chunk) every 100 rows from an Oracle DB to a tSOAP call.

 

Thanks

JR1
Creator III
Creator III

For Oracle DBs, you would have to get the row count first by using a tDBRow component and performing a "SELECT COUNT(*) FROM XXX WHERE YYY". Use a tFlowToIterate component after that and store the only result record (there can be only one) via a tSetGlobalVar in a global variable.

Instead of the second tFileInputXXX component, you would use a tDBInput component and for Oracle, you would use a statement like the following:

 

SELECT A, B, C, D FROM XXX WHERE YYY AND ROWNUM > " + String.valueOf(((Integer)globalMap.get("tLoop_1_CURRENT_VALUE")))) + " AND ROWNUM < " + String.valueOf(((Integer)globalMap.get("tLoop_1_CURRENT_VALUE"))) +100)

 

I think PostgreSQL and MySQL (and others) do not have the ROWNUM pseudo-column - you will have to find your own way here...

Anonymous
Not applicable
Author

I am trying to do the same thing in sql server. I am able to get trest call out for one row. In that case i am using value from 1 to row count with step as 1 in tloop component and the output of tdbinput am writing as global variable in tjava. But am not able to do the same in batch of 10. I am able to do till tdbinput by putting where condtion as  id >=" + (Integer)globalMap.get("tLoop_1_CURRENT_VALUE") + "and id <= " + (Integer)globalMap.get("tLoop_1_CURRENT_VALUE") +10 . But not able to proceed after that. I tried titeratetoflow with value ((String)globalMap.get("tDBinput_4_QUERY")).

 

Below is my job:

 

 


new_job_issue.jpg
Anonymous
Not applicable
Author

Is someone online and can help me...thanks