<?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 Issue with Using While Loop  with Sql in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321326#M91365</link>
    <description>&lt;P&gt;I have an issue after implementing tLoop , it is not looping dates starting from&amp;nbsp;&lt;SPAN&gt;1981-02-21 until&amp;nbsp;1981-02-26 ..&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;It is starting from&amp;nbsp;1981-02-22..&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Kindly help me out&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Gave values in the context as&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;vStartDate = 1981-02-21&lt;/P&gt; 
&lt;P&gt;vEndDate = 1981-02-26&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJava_1 as below code&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;java.util.Date start_date=TalendDate.parseDate("yyyy-MM-dd", context.vStartDate);
java.util.Date end_date=TalendDate.parseDate("yyyy-MM-dd", context.vEndDate);
long l=TalendDate.diffDate(end_date, start_date);
context.vDiff=l;
System.out.println(context.vDiff);
System.out.println(start_date);&lt;/PRE&gt; 
&lt;P&gt;tLoop gave as while loop as below&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;context.vDiff&amp;gt;0L&lt;/PRE&gt; 
&lt;P&gt;In the DB sql query as below&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT emp.emp_no,
		emp.emp_name,
		emp.job_title,
		emp.manager_id,
		emp.hire_date,
		emp.salary,
		emp.commission,
		emp.dept_no
FROM	tempdw.emp
where emp.hire_date ='"+context.vStartDate+"'"&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left"&gt;&lt;SPAN class="lia-message-image-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls6n.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133715i9B202516ACC1E886/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls6n.png" alt="0683p000009Ls6n.png" /&gt;&lt;/span&gt;&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;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Result as below&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left"&gt;&lt;SPAN class="lia-message-image-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lrte.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131803i95DCF9335105C60B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lrte.png" alt="0683p000009Lrte.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 19:30:34 GMT</pubDate>
    <dc:creator>Karuetl</dc:creator>
    <dc:date>2018-01-24T19:30:34Z</dc:date>
    <item>
      <title>Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321326#M91365</link>
      <description>&lt;P&gt;I have an issue after implementing tLoop , it is not looping dates starting from&amp;nbsp;&lt;SPAN&gt;1981-02-21 until&amp;nbsp;1981-02-26 ..&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;It is starting from&amp;nbsp;1981-02-22..&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Kindly help me out&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Gave values in the context as&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;vStartDate = 1981-02-21&lt;/P&gt; 
&lt;P&gt;vEndDate = 1981-02-26&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJava_1 as below code&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;java.util.Date start_date=TalendDate.parseDate("yyyy-MM-dd", context.vStartDate);
java.util.Date end_date=TalendDate.parseDate("yyyy-MM-dd", context.vEndDate);
long l=TalendDate.diffDate(end_date, start_date);
context.vDiff=l;
System.out.println(context.vDiff);
System.out.println(start_date);&lt;/PRE&gt; 
&lt;P&gt;tLoop gave as while loop as below&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;context.vDiff&amp;gt;0L&lt;/PRE&gt; 
&lt;P&gt;In the DB sql query as below&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT emp.emp_no,
		emp.emp_name,
		emp.job_title,
		emp.manager_id,
		emp.hire_date,
		emp.salary,
		emp.commission,
		emp.dept_no
FROM	tempdw.emp
where emp.hire_date ='"+context.vStartDate+"'"&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left"&gt;&lt;SPAN class="lia-message-image-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls6n.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133715i9B202516ACC1E886/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls6n.png" alt="0683p000009Ls6n.png" /&gt;&lt;/span&gt;&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;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Result as below&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left"&gt;&lt;SPAN class="lia-message-image-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lrte.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131803i95DCF9335105C60B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lrte.png" alt="0683p000009Lrte.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 19:30:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321326#M91365</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-24T19:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321327#M91366</link>
      <description>Hi, 
&lt;BR /&gt;Connect 1 or more t&amp;lt;yourDb&amp;gt;Row component after a tLoop. 
&lt;BR /&gt;For MySQL, you may have multiple queries for a single tMySqlRow (see this post 
&lt;A href="https://community.qlik.com/s/article/ka03p0000006EZxAAM" target="_blank"&gt;https://community.talend.com/t5/Migration-Configuration-and/Executing-multiple-SQL-statements-with-one-tMysqlRow-component/ta-p/21672&lt;/A&gt;).</description>
      <pubDate>Wed, 24 Jan 2018 22:06:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321327#M91366</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-01-24T22:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321328#M91367</link>
      <description>&lt;P&gt;I would like to know how i can increment the startdate value and pass it to both loop and th equery&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 22:13:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321328#M91367</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-24T22:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321329#M91368</link>
      <description>&lt;P&gt;Refer to &lt;A href="https://help.talend.com/reader/Wn542xW1ESfwvKplSdMSHg/qHceroKoduPt3ck8KoV3Rw" target="_self" rel="nofollow noopener noreferrer"&gt;TalendDate routines&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 11:04:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321329#M91368</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-01-25T11:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321330#M91369</link>
      <description>&lt;P&gt;I have an issue after implementing tLoop , it is not looping dates starting from&amp;nbsp;&lt;SPAN&gt;1981-02-21 until&amp;nbsp;1981-02-26 ..&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;It is starting from&amp;nbsp;1981-02-22..&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Kindly help me out&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Gave values in the context as&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;vStartDate = 1981-02-21&lt;/P&gt; 
&lt;P&gt;vEndDate = 1981-02-26&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJava_1 as below code&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;java.util.Date start_date=TalendDate.parseDate("yyyy-MM-dd", context.vStartDate);
java.util.Date end_date=TalendDate.parseDate("yyyy-MM-dd", context.vEndDate);
long l=TalendDate.diffDate(end_date, start_date);
context.vDiff=l;
System.out.println(context.vDiff);
System.out.println(start_date);&lt;/PRE&gt; 
&lt;P&gt;tLoop gave as while loop as below&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;context.vDiff&amp;gt;0L&lt;/PRE&gt; 
&lt;P&gt;In the DB sql query as below&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT emp.emp_no,
		emp.emp_name,
		emp.job_title,
		emp.manager_id,
		emp.hire_date,
		emp.salary,
		emp.commission,
		emp.dept_no
FROM	tempdw.emp
where emp.hire_date ='"+context.vStartDate+"'"&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="1.PNG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls6n.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133715i9B202516ACC1E886/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls6n.png" alt="0683p000009Ls6n.png" /&gt;&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;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Result as below&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="2.PNG" style="width: 376px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lrte.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131803i95DCF9335105C60B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lrte.png" alt="0683p000009Lrte.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 21:39:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321330#M91369</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-25T21:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321331#M91370</link>
      <description>&lt;P&gt;Hi Karuetl&lt;/P&gt; 
&lt;P&gt;I think you don't configure the while condition correctly on tLoop. I have a similar case that does a loop on each month, see&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lroe.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129736i34B53BFF3355B18A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lroe.png" alt="0683p000009Lroe.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;context.monthStarting is a variable with int type.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I hope it gives you hints to do a loop on day&amp;nbsp;interval.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards&lt;/P&gt; 
&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 13:37:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321331#M91370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-26T13:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321332#M91371</link>
      <description>&lt;P&gt;issue is in the SQL query i am using the context.vStartDate value and for first time it is not passing the start value but the incremental one ...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 14:11:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321332#M91371</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-26T14:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321333#M91372</link>
      <description>&lt;P&gt;I am actually incrementing using the tJava2&amp;nbsp; as below&amp;nbsp; .... Still unable to get first vStartDate into the Query&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="1.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls8K.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149660i0F6CBBF663FA2F69/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls8K.png" alt="0683p000009Ls8K.png" /&gt;&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;</description>
      <pubDate>Fri, 26 Jan 2018 22:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321333#M91372</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-26T22:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321334#M91373</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Can u please attach the screenshot of tloop component section ?&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;Praveen M.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2018 06:54:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321334#M91373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-27T06:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321335#M91374</link>
      <description>Hi, 
&lt;BR /&gt;"tJava will be executed first, but only once in the subjob" as explained here 
&lt;A href="https://community.qlik.com/s/article/ka03p0000006EXqAAM" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/What-is-the-difference-between-tJava-tJavaRow-and-tJavaFlex/ta-p/21505&lt;/A&gt; 
&lt;BR /&gt;So, as it seems startDate is incremented in your tJava, the loop starts with 1981-02-22. 
&lt;BR /&gt;Hope this helps.</description>
      <pubDate>Sat, 27 Jan 2018 13:33:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321335#M91374</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-01-27T13:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Using While Loop  with Sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321336#M91375</link>
      <description>&lt;P&gt;I have resolved the issue instead of OnSubJob OK , I used onComponent Ok .. It worked well ....&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:47:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-Using-While-Loop-with-Sql/m-p/2321336#M91375</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-29T21:47:31Z</dc:date>
    </item>
  </channel>
</rss>

