<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use tLoop and pass SQL query result as upper limit to it in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Use-tLoop-and-pass-SQL-query-result-as-upper-limit-to-it/m-p/2217323#M12960</link>
    <description>&lt;P&gt;Your tSetGlobalVar shouldn't need the ....&lt;/P&gt; 
&lt;PRE&gt;((String)globalMap.get("row2.count_loop"))&lt;/PRE&gt; 
&lt;P&gt;All it should need is .....&lt;/P&gt; 
&lt;PRE&gt;row2.count_loop&lt;/PRE&gt; 
&lt;P&gt;This should already be a number (I assume an Integer) so when you read it in the tLoop you should just need to use....&lt;/P&gt; 
&lt;PRE&gt;((Integer)globalMap.get("myKey"))&lt;/PRE&gt; 
&lt;P&gt;The tSetGlobalVar just needs the row and column name in the value and the name must be what you want it to be called. You have left it as "myKey" in your job. When you want to read it's value, you will need to know what data type it is (my assumption is Integer) and then just retrieve it using it's name (in this case "myKey") like above.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2019 10:00:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-24T10:00:21Z</dc:date>
    <item>
      <title>Use tLoop and pass SQL query result as upper limit to it</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Use-tLoop-and-pass-SQL-query-result-as-upper-limit-to-it/m-p/2217322#M12959</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;i'm trying to pass the result of a sql query to a tLoop like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tLoop_Job.png" style="width: 693px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7rv.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141310iEC701152F20DF288/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7rv.png" alt="0683p000009M7rv.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The query has a single integer as ouput (set via Edit schema) and basically counts how many blocks of&amp;nbsp; thousand rows are in the result.&lt;/P&gt; 
&lt;P&gt;This single int value should be passed to a tLoop component as upper limit.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tDBInput_mig10_liste_count.png" style="width: 784px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7s0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150913i43CB0D6D2EBE4FF5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7s0.png" alt="0683p000009M7s0.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I can set the value successfully in a tSetGlobalVar as String format.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tSetGlobalVar_1.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7s5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136783i446985B4D77F9D13/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7s5.png" alt="0683p000009M7s5.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But whatever i try for the tLoop component it hits either Null Exceptions or Conversions Errors when i try to convert to the int type required for the loop.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Format_error.png" style="width: 933px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7sA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137594i5B585F5C8C7D2093/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7sA.png" alt="0683p000009M7sA.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The tLoop looks like this for example:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tLoop_liste_loop.png" style="width: 661px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7sF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154204i6359D1F3DB54C439/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7sF.png" alt="0683p000009M7sF.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I hit the same error if i try to use that conversion to Integer in the tSetGlobalVar, so it's not linked to a specific tLoop issue, but rather me doing the conversion wrong...&lt;/P&gt; 
&lt;P&gt;How must my job look to get the sql query result into the loop as upper limit?&lt;/P&gt; 
&lt;P&gt;How can i pass the int value to the tLoop?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Kind Regards&lt;/P&gt; 
&lt;P&gt;Thomas&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Use-tLoop-and-pass-SQL-query-result-as-upper-limit-to-it/m-p/2217322#M12959</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T04:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Use tLoop and pass SQL query result as upper limit to it</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Use-tLoop-and-pass-SQL-query-result-as-upper-limit-to-it/m-p/2217323#M12960</link>
      <description>&lt;P&gt;Your tSetGlobalVar shouldn't need the ....&lt;/P&gt; 
&lt;PRE&gt;((String)globalMap.get("row2.count_loop"))&lt;/PRE&gt; 
&lt;P&gt;All it should need is .....&lt;/P&gt; 
&lt;PRE&gt;row2.count_loop&lt;/PRE&gt; 
&lt;P&gt;This should already be a number (I assume an Integer) so when you read it in the tLoop you should just need to use....&lt;/P&gt; 
&lt;PRE&gt;((Integer)globalMap.get("myKey"))&lt;/PRE&gt; 
&lt;P&gt;The tSetGlobalVar just needs the row and column name in the value and the name must be what you want it to be called. You have left it as "myKey" in your job. When you want to read it's value, you will need to know what data type it is (my assumption is Integer) and then just retrieve it using it's name (in this case "myKey") like above.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 10:00:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Use-tLoop-and-pass-SQL-query-result-as-upper-limit-to-it/m-p/2217323#M12960</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-24T10:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Use tLoop and pass SQL query result as upper limit to it</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Use-tLoop-and-pass-SQL-query-result-as-upper-limit-to-it/m-p/2217324#M12961</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;setting row2.COUNT_LOOP directly in the&amp;nbsp;tSetGlobalVariable solved the problem!&lt;/P&gt; 
&lt;P&gt;I had already tried to set row2.count_loop in my attempts, but missed that it is actually case sensitiv.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;It is now working like this:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tSetGlobalVar_2.png" style="width: 955px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7ZF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137046i1950DDD7F09BC2C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7ZF.png" alt="0683p000009M7ZF.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tLoop_liste_loop_2.png" style="width: 465px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7sK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136359i083586BC820B60A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7sK.png" alt="0683p000009M7sK.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Kind Regards&lt;/P&gt; 
&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 11:35:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Use-tLoop-and-pass-SQL-query-result-as-upper-limit-to-it/m-p/2217324#M12961</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-24T11:35:03Z</dc:date>
    </item>
  </channel>
</rss>

