<?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: Delete data sequentially from a large mysql table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Delete-data-sequentially-from-a-large-mysql-table/m-p/2250086#M34431</link>
    <description>Hi 
&lt;BR /&gt;Yes, you need to use a tLoop to loop the execution until the nbrows=0, eg: 
&lt;BR /&gt;tLoop-iterate--tMysqlRow--oncomponent--tMysqlInput--main--tjavaRow 
&lt;BR /&gt; 
&lt;BR /&gt;Define a context variable with boolean type, let's call it 'condition', set the default value as true; 
&lt;BR /&gt;On tLoop, select 'while' type and set the condition with context variable:context.condition 
&lt;BR /&gt;on tMysqlRow, execute the deletion statement. 
&lt;BR /&gt;"delete from tableName where operator_id=39 limit 10000" 
&lt;BR /&gt;on tMysqlInput, define one column with int type, let's call it nb_rows, query the number of rows, 
&lt;BR /&gt;"select count(*) from tableName where operator_id=39" 
&lt;BR /&gt; 
&lt;BR /&gt;on tJavaRow: 
&lt;BR /&gt;if(input_row.nb_rows&amp;gt;0){ 
&lt;BR /&gt;context.condition=true; 
&lt;BR /&gt;}else{ 
&lt;BR /&gt;context.condition=false; 
&lt;BR /&gt;} 
&lt;BR /&gt; 
&lt;BR /&gt;Hope it helps you! 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong 
&lt;BR /&gt;</description>
    <pubDate>Tue, 19 Nov 2019 04:44:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-19T04:44:43Z</dc:date>
    <item>
      <title>Delete data sequentially from a large mysql table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Delete-data-sequentially-from-a-large-mysql-table/m-p/2250085#M34430</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I would like to make sequential deletions of a mysql table for example: delete 10000 lines by 10000 lines for a given condition (like : where operator_id=39),&lt;BR /&gt;using either a loop or a component that makes deletions by data block.&lt;/P&gt;
&lt;P&gt;like ( while : nbrows &amp;gt;0 ---&amp;gt; delete from table xxx where operator_id=39 limit 10000) or something like that.&lt;/P&gt;
&lt;P&gt;Any Help please ?&lt;/P&gt;
&lt;P&gt;thx you.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 16:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Delete-data-sequentially-from-a-large-mysql-table/m-p/2250085#M34430</guid>
      <dc:creator>Shinigaloo</dc:creator>
      <dc:date>2019-11-11T16:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Delete data sequentially from a large mysql table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Delete-data-sequentially-from-a-large-mysql-table/m-p/2250086#M34431</link>
      <description>Hi 
&lt;BR /&gt;Yes, you need to use a tLoop to loop the execution until the nbrows=0, eg: 
&lt;BR /&gt;tLoop-iterate--tMysqlRow--oncomponent--tMysqlInput--main--tjavaRow 
&lt;BR /&gt; 
&lt;BR /&gt;Define a context variable with boolean type, let's call it 'condition', set the default value as true; 
&lt;BR /&gt;On tLoop, select 'while' type and set the condition with context variable:context.condition 
&lt;BR /&gt;on tMysqlRow, execute the deletion statement. 
&lt;BR /&gt;"delete from tableName where operator_id=39 limit 10000" 
&lt;BR /&gt;on tMysqlInput, define one column with int type, let's call it nb_rows, query the number of rows, 
&lt;BR /&gt;"select count(*) from tableName where operator_id=39" 
&lt;BR /&gt; 
&lt;BR /&gt;on tJavaRow: 
&lt;BR /&gt;if(input_row.nb_rows&amp;gt;0){ 
&lt;BR /&gt;context.condition=true; 
&lt;BR /&gt;}else{ 
&lt;BR /&gt;context.condition=false; 
&lt;BR /&gt;} 
&lt;BR /&gt; 
&lt;BR /&gt;Hope it helps you! 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong 
&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Nov 2019 04:44:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Delete-data-sequentially-from-a-large-mysql-table/m-p/2250086#M34431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-19T04:44:43Z</dc:date>
    </item>
  </channel>
</rss>

