<?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: tmysqloutput to be use for data manipulation in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tmysqloutput-to-be-use-for-data-manipulation/m-p/2271534#M49086</link>
    <description>&lt;P&gt;Thanks for the response and for the possible solution, I am going to try it and once all good and working, I will update this topic &lt;IMG id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://yutwg22796.i.lithium.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Oct 2018 17:28:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-21T17:28:18Z</dc:date>
    <item>
      <title>tmysqloutput to be use for data manipulation</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmysqloutput-to-be-use-for-data-manipulation/m-p/2271532#M49084</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Is it possible that for example I have&amp;nbsp; a table Initial and Main.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Initial columns are: ID, Name, Address, Job, KeyVal,&amp;nbsp;&lt;SPAN&gt;ChangeFlag&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Main &lt;SPAN&gt;columns are:&lt;/SPAN&gt; ID, Address, Job, Keyval&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;ChangeFlag vakues are DEL, MOD, ADD which means the actions that needs to be executed on the main table.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Sample Data:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;ID = 1111&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Name = George Elvin&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Address = Somewhere Out There&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Keyval = qwerty&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;ChangeFlag = DEL&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Main Table:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;ID = 1111&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Name = George Elvin&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Address = Somewhere Out There&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Keyval = qwerty&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;&lt;SPAN&gt;So meaning that Row should be deleted base on the ChangeFlag value, if the value is Add then insert, if MOD then Update and if DEL then Delete, how can I do that using tmysqluoutput of Initial Table to execute the action needed to Main table?&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 00:33:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmysqloutput-to-be-use-for-data-manipulation/m-p/2271532#M49084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-21T00:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: tmysqloutput to be use for data manipulation</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmysqloutput-to-be-use-for-data-manipulation/m-p/2271533#M49085</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using tMySQLoutput components you can select only one action on the the table at a time either insert or update or delete.&lt;/P&gt;
&lt;P&gt;For your task following will be the possible solutions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Solution1- Use a tMap component after&amp;nbsp;&lt;SPAN&gt;Initial&amp;nbsp;flow and create three different output flow using filter condition in tMap then you have to use three tMysqlOutput component with Insert, Update and delete action.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Solution2. We can also use tMysqlRow component for this action but before this we have to use a tjavaRow component and write some javacode to compare&amp;nbsp;&lt;SPAN&gt;ChangeFlag = DELETE or UPDATE or INSERT.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if("DEL".equalsIgnoreCase(imput_row.ChangeFlag))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;output_row.query=delete from table where ---some condition&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;else if("UPDATE".equalsIgnoreCase(imput_row.ChangeFlag))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;output_row.query=UPDATE table&amp;nbsp;SET =VALUES where ---some condition&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;else if("INSERT".equalsIgnoreCase(imput_row.ChangeFlag))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;output_row.query=insert query&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then using a tJavaRow component we have to run this query on database&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;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kailash&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 12:45:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmysqloutput-to-be-use-for-data-manipulation/m-p/2271533#M49085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-21T12:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: tmysqloutput to be use for data manipulation</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmysqloutput-to-be-use-for-data-manipulation/m-p/2271534#M49086</link>
      <description>&lt;P&gt;Thanks for the response and for the possible solution, I am going to try it and once all good and working, I will update this topic &lt;IMG id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://yutwg22796.i.lithium.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 17:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmysqloutput-to-be-use-for-data-manipulation/m-p/2271534#M49086</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-21T17:28:18Z</dc:date>
    </item>
  </channel>
</rss>

