<?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: [resolved] Delete MySQL row on condition in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346196#M113627</link>
    <description>Thank you for you answer.&lt;BR /&gt;Indeed, I could test it by myself.</description>
    <pubDate>Fri, 31 May 2013 16:07:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-05-31T16:07:39Z</dc:date>
    <item>
      <title>[resolved] Delete MySQL row on condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346190#M113621</link>
      <description>Hi,&lt;BR /&gt;I have a simple tMap between 2 different MySQL databases.&lt;BR /&gt;When a row from DB1 (input) is inserted (after mapping) into DB2 (output) with no error, I want the row from DB1 to be deleted. However, the ID from DB1 is not sent to DB2, and I don't know how to get this ID.&lt;BR /&gt;Is anyone can help me ?</description>
      <pubDate>Sat, 16 Nov 2024 12:00:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346190#M113621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Delete MySQL row on condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346191#M113622</link>
      <description>There are two obvious ways to do this:
&lt;BR /&gt;1) Iterate over each row from DB1. For each row, do the transform save the ID to a context variable. If successfully inserted to DB2, execute a delete statement on DB1 using the saved ID. 
&lt;BR /&gt;2) Maintain a list of ID's from DB1 that were successfully inserted, Then delete after all rows have been processed. This can be done within memory in Talend by using a tHashOutput/tHashInput pair. Alternatively, you could write the successful inserts ID's to file and re-read it once done.</description>
      <pubDate>Tue, 28 May 2013 16:43:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346191#M113622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-28T16:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Delete MySQL row on condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346192#M113623</link>
      <description>Thank you. I tried the first solution. 
&lt;BR /&gt;See what I've done in attached screenshot . 
&lt;BR /&gt;I save the ID in the tMap and I use it in the tMySQLRow (deleteProcessedEvent) 
&lt;BR /&gt;But I don't know how to execute deleteProcessedEvent for each row inserted. 
&lt;BR /&gt;I tried OnComponentOk but it is executed once the all rows have been inserted, so it delete only the last one. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MET9.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133890i7682C1BF31DBE630/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MET9.jpg" alt="0683p000009MET9.jpg" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 29 May 2013 10:50:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346192#M113623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-29T10:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Delete MySQL row on condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346193#M113624</link>
      <description>Use a row link instead of OnComponentOk.&lt;BR /&gt;You can perhaps also pass the ID to the tMysqlOuput for DB2 but use the "Field options" in the advanced settings to not insert it, then it is available to pass through to another tMysqlOuput for the deletion from DB1.&lt;BR /&gt;Or just have a second flow from the tMap to another tMysqlOuput  for the deletion from DB1.</description>
      <pubDate>Thu, 30 May 2013 08:56:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346193#M113624</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-05-30T08:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Delete MySQL row on condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346194#M113625</link>
      <description>Thank you! It works!&lt;BR /&gt;However, how do I know if the row is deleted only if the insert succeed ?&lt;BR /&gt;What happen if an error occurs ? Is the row deleted anyway ?</description>
      <pubDate>Thu, 30 May 2013 14:46:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346194#M113625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-30T14:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Delete MySQL row on condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346195#M113626</link>
      <description>If the insert fails, the tMysqlOuput will not pass a row on to any following components and so they will not do anything.  This is easy enough to test.</description>
      <pubDate>Fri, 31 May 2013 00:17:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346195#M113626</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-05-31T00:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Delete MySQL row on condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346196#M113627</link>
      <description>Thank you for you answer.&lt;BR /&gt;Indeed, I could test it by myself.</description>
      <pubDate>Fri, 31 May 2013 16:07:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Delete-MySQL-row-on-condition/m-p/2346196#M113627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-31T16:07:39Z</dc:date>
    </item>
  </channel>
</rss>

