<?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: Read data form a database function until return no rows in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204626#M5432</link>
    <description>&lt;P&gt;double check&amp;nbsp; GlobalMap Variable Name "tDBInput_2_NB_LINE". Is&amp;nbsp; number in this correct ?&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="TalendImage.JPG" style="width: 892px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M45c.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134007i16BE62E2BE81290B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M45c.jpg" alt="0683p000009M45c.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Mar 2019 12:55:10 GMT</pubDate>
    <dc:creator>akumar2301</dc:creator>
    <dc:date>2019-03-29T12:55:10Z</dc:date>
    <item>
      <title>Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204618#M5424</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm doing a job that returns from a function limited rows with data.&lt;/P&gt;
&lt;P&gt;I have to read the data until the function return no rows, so, the function return 1000 rows each time&lt;/P&gt;
&lt;P&gt;example:&lt;/P&gt;
&lt;P&gt;I have 2028 rows in the function:&lt;/P&gt;
&lt;P&gt;I run the job and the function&amp;nbsp;returns 1000&lt;/P&gt;
&lt;P&gt;then&lt;/P&gt;
&lt;P&gt;I run again and&amp;nbsp;the function&amp;nbsp;returns 1000&lt;/P&gt;
&lt;P&gt;then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run again and&amp;nbsp;the function&amp;nbsp;returns 28&lt;/P&gt;
&lt;P&gt;then&lt;/P&gt;
&lt;P&gt;I run again and&amp;nbsp;the function&amp;nbsp;returns 0&lt;/P&gt;
&lt;P&gt;then create the file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do this loop?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone can help me?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Elisabete&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 11:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204618#M5424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-27T11:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204619#M5425</link>
      <description>&lt;P&gt;You mean , your function returns RecordSet of n Number of rows.If Yes, to execute parse the recordset of tDBxxSP,&amp;nbsp; you must be using tParseRecordSet.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can compare&amp;nbsp;((Integer)globalMap.get("tParseRecordSet_1_NB_LINE")) in tLoop condition. Run loop only if it is not equal to zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 14:11:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204619#M5425</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-27T14:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204620#M5426</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;no, What I want is read data from a tinputDB, but is an database fucntion, and is limited to the number of rows you can read... I need to read it and load to a thashOutput&amp;nbsp;(append) until the function returned zero rows, like&amp;nbsp;((Integer)globalMap.get("tDBInput_2_NB_LINE"))=0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you help me?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 15:03:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204620#M5426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-27T15:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204621#M5427</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;Not able to understand ,&lt;SPAN&gt;"read data from a tinputDB, but is an database fucntion ". &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you please explain more about this function and if it is a function , how you are planning to use in tDBINPUT?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 15:58:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204621#M5427</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-27T15:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204622#M5428</link>
      <description>&lt;P&gt;Hi Elizabeth,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I agree with&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LP7CAAW"&gt;@uganesh&lt;/A&gt;&amp;nbsp;- it is not clear from your description what is function, how it work and etc&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;but let take a global case - you have 2028 rows in the database for processing and what process not more than 1000 rows at one iteration&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;in this case, job design is simple&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;first of all - we need or mark rows as processed or store processed rows id in separate table&lt;/LI&gt; 
 &lt;LI&gt;then in tDBInput we use query like:&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;PRE&gt;SELECT * FROM table_a WHERE proceessed = 0 LIMIT 1000&lt;/PRE&gt; 
&lt;P&gt;or&lt;/P&gt; 
&lt;PRE&gt;SELECT * FROM table_a ta WHERE NOT EXISTS (select * from processed_table pt where pt.id = pa.id ) LIMIT 1000&lt;/PRE&gt; 
&lt;UL&gt; 
 &lt;LI&gt;at the end of job - you are OR UPDATE original table and mark processed id OR just INSERT id into processed_table&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;that all&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;regards, Vlad&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 11:59:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204622#M5428</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2019-03-28T11:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204623#M5429</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;what I want is a loop in tDBInout until the query return no rows. The query is a function, something like "select field1 from fct_example('PUSH')" but this is&amp;nbsp;&lt;SPAN&gt;limited to 1000 rows each time I execute the query and delete the data that has been read (this is what the function do), so if the function has 2028, I have to execute the job as many times as necessary to return no rows.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lv3s"&gt;Job_Loop.PNG&lt;/A&gt;</description>
      <pubDate>Fri, 29 Mar 2019 12:19:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204623#M5429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-29T12:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204624#M5430</link>
      <description>&lt;P&gt;did you try tLoop before tDbInput with condition "while&amp;nbsp; condition"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;((Integer)globalMap.get("tDBInput_2_NB_LINE")) == null ||&lt;BR /&gt;((Integer)globalMap.get("tDBInput_2_NB_LINE")) != 0&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 12:41:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204624#M5430</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-29T12:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204625#M5431</link>
      <description>&lt;P&gt;yes, and is always running the job.&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;Null value will be used for context parameter queryloop: For input string: ""&lt;BR /&gt;[statistics] connecting to socket on port 3640&lt;BR /&gt;[statistics] connected&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Send the configuration of the loop, I'm newer in talend, I worked with datastage and this is a quiet diferent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LvFh"&gt;Job_Loop2.PNG&lt;/A&gt;</description>
      <pubDate>Fri, 29 Mar 2019 12:47:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204625#M5431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-29T12:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204626#M5432</link>
      <description>&lt;P&gt;double check&amp;nbsp; GlobalMap Variable Name "tDBInput_2_NB_LINE". Is&amp;nbsp; number in this correct ?&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="TalendImage.JPG" style="width: 892px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M45c.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134007i16BE62E2BE81290B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M45c.jpg" alt="0683p000009M45c.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 12:55:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204626#M5432</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-29T12:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Read data form a database function until return no rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204627#M5433</link>
      <description>&lt;P&gt;Thanks, that&amp;nbsp;works&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 13:03:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Read-data-form-a-database-function-until-return-no-rows/m-p/2204627#M5433</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-29T13:03:20Z</dc:date>
    </item>
  </channel>
</rss>

