<?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 Using While Loop and subjob with SqlRequest in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Using-While-Loop-and-subjob-with-SqlRequest/m-p/2308710#M80009</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;Hi everyone !&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;I have a problem with inserting a while loop that would contain a Subjob of data extraction.&lt;BR /&gt;&lt;BR /&gt;My query retrieves records between two dates. I have to add 10 days to a date if my request does not return any records. You have to be able to do it X times before getting out of the loop. If at least one record is returned, I leave the loop.&lt;BR /&gt;&lt;BR /&gt;The idea is to do:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;int i;
while (i = 0; i &amp;lt;4; i ++)
{
     \\\\\\\\\\\\\\\subjob//////////////

      int nbRow = ((Integer) globalMap.get ("tOracleOutput_2_NB_LINE")). intValue ();

      if (nbRow! = 0)
         break;
      else {
               context.DateMax= TalendDate.addDate (context.sDateMax, 10, "dd");
               context.sDateMax= TalendDate.formatDateLocale ("dd-MMM-yyyy hh: mm: ss", context.sDateMax, "EN");
      }
}&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Here is my subjob:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="While.PNG" style="width: 974px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls99.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155462iE24C68742C634082/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls99.png" alt="0683p000009Ls99.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Obviously, it doesn't work so...did anyone know how to do this?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Thanks for your time !!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;DIV&gt;
  &amp;nbsp; 
&lt;/DIV&gt;</description>
    <pubDate>Wed, 17 Jan 2018 08:47:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-17T08:47:41Z</dc:date>
    <item>
      <title>Using While Loop and subjob with SqlRequest</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-While-Loop-and-subjob-with-SqlRequest/m-p/2308710#M80009</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Hi everyone !&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;I have a problem with inserting a while loop that would contain a Subjob of data extraction.&lt;BR /&gt;&lt;BR /&gt;My query retrieves records between two dates. I have to add 10 days to a date if my request does not return any records. You have to be able to do it X times before getting out of the loop. If at least one record is returned, I leave the loop.&lt;BR /&gt;&lt;BR /&gt;The idea is to do:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;int i;
while (i = 0; i &amp;lt;4; i ++)
{
     \\\\\\\\\\\\\\\subjob//////////////

      int nbRow = ((Integer) globalMap.get ("tOracleOutput_2_NB_LINE")). intValue ();

      if (nbRow! = 0)
         break;
      else {
               context.DateMax= TalendDate.addDate (context.sDateMax, 10, "dd");
               context.sDateMax= TalendDate.formatDateLocale ("dd-MMM-yyyy hh: mm: ss", context.sDateMax, "EN");
      }
}&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Here is my subjob:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="While.PNG" style="width: 974px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls99.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155462iE24C68742C634082/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls99.png" alt="0683p000009Ls99.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Obviously, it doesn't work so...did anyone know how to do this?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Thanks for your time !!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;DIV&gt;
  &amp;nbsp; 
&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Jan 2018 08:47:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-While-Loop-and-subjob-with-SqlRequest/m-p/2308710#M80009</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-17T08:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using While Loop and subjob with SqlRequest</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-While-Loop-and-subjob-with-SqlRequest/m-p/2308711#M80010</link>
      <description>&lt;P&gt;The while loop in your Java component will execute in its entirety before moving on to the next subjob.&amp;nbsp; If you want to control execution of other components, you can use the tLoop component.&amp;nbsp; Set the Condition setting to a globalMap boolean variable containing false.&amp;nbsp; A Java component inside the loop can check the conditions and set the globalMap variable to true when you want the loop to end.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 15:47:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-While-Loop-and-subjob-with-SqlRequest/m-p/2308711#M80010</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2018-01-17T15:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using While Loop and subjob with SqlRequest</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-While-Loop-and-subjob-with-SqlRequest/m-p/2308712#M80011</link>
      <description>&lt;P&gt;Thanks for your quick answer. It works great !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 16:43:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-While-Loop-and-subjob-with-SqlRequest/m-p/2308712#M80011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-17T16:43:39Z</dc:date>
    </item>
  </channel>
</rss>

