<?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 'Action on Data' options in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tMysqlOutput-Action-on-Data-options/m-p/2375497#M137905</link>
    <description>Hello 
&lt;BR /&gt;1)Action On Data: Insert or update on duplicate key or unique index: 
&lt;BR /&gt;Gnenerally, the job will throws an java exception as below when you insert a duplicate row into table which have one or more columns are pk column. 
&lt;BR /&gt;Exception in component tMysqlOutput_1 
&lt;BR /&gt;com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 1 
&lt;BR /&gt;if you choose this action on data' insert or update on duplicate key or unique index', it will ignore the exception, if the pk column exists, update the non-pk columns, otherwise, insert new row. 
&lt;BR /&gt;Let's take an exmaple? 
&lt;BR /&gt;here is a table, id is a pk : 
&lt;BR /&gt;CREATE TABLE `person` ( 
&lt;BR /&gt; `id` int(11) NOT NULL, 
&lt;BR /&gt; `name` varchar(11) default NULL, 
&lt;BR /&gt; PRIMARY KEY (`id`) 
&lt;BR /&gt; ) ENGINE=MyISAM AUTO_INCREMENT=104 DEFAULT CHARSET=latin1 
&lt;BR /&gt;there are two rows in the table now: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;mike 
&lt;BR /&gt;2;shong 
&lt;BR /&gt;I will load the three rows as below into table: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;mike1 
&lt;BR /&gt;2;shong1 
&lt;BR /&gt;3;elise 
&lt;BR /&gt;result will be: 
&lt;BR /&gt;1;mike1 
&lt;BR /&gt;2;shong1 
&lt;BR /&gt;3;elise 
&lt;BR /&gt;2) Action On Data: Insert 
&lt;BR /&gt; Advanced settings: Check 'Use duplicate key update mode insert 
&lt;BR /&gt;it is similar with action on data 'insert or update on duplicate key or unique index', but there is a little difference, it will update the specified non-pk column with fixed value if the pk column exist. For exmaple 
&lt;BR /&gt;there are two rows in the table now: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;mike 
&lt;BR /&gt;2;shong 
&lt;BR /&gt;I will load the three rows as below into table: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;mike1 
&lt;BR /&gt;2;shong1 
&lt;BR /&gt;3;elise 
&lt;BR /&gt;I choose action on data 'insert' and check 'Use duplicate key update mode insert' option, specify a non-pk column with a fixed value as screenshot shows. 
&lt;BR /&gt;result will be: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;a fixed value 
&lt;BR /&gt;2;a fixed value 
&lt;BR /&gt;3;elise 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; shong</description>
    <pubDate>Tue, 23 Feb 2010 10:10:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-02-23T10:10:20Z</dc:date>
    <item>
      <title>tMysqlOutput 'Action on Data' options</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMysqlOutput-Action-on-Data-options/m-p/2375496#M137904</link>
      <description>Hi! 
&lt;BR /&gt;In tMysqlOutput, what's the difference between the following options: 
&lt;BR /&gt;1) Action On Data: Insert 
&lt;BR /&gt; Advanced settings: Check 'Use duplicate key update mode insert' 
&lt;BR /&gt;2) Action On Data: Insert or update on duplicate key or unique index. 
&lt;BR /&gt;I checked the syntax generated and they seem to be exactly the same except 1) insert into and 2) insert IGNORE into. I am not sure if IGNORE helps much here since the purpose is not to ignore update record silently (we do want to update the record). What would be the reason to choose one over another? 
&lt;BR /&gt;Also in what scenario would you choose 'Insert or Update' over 'Update or Insert' option? 
&lt;BR /&gt;Thanks</description>
      <pubDate>Sat, 16 Nov 2024 13:32:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMysqlOutput-Action-on-Data-options/m-p/2375496#M137904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: tMysqlOutput 'Action on Data' options</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMysqlOutput-Action-on-Data-options/m-p/2375497#M137905</link>
      <description>Hello 
&lt;BR /&gt;1)Action On Data: Insert or update on duplicate key or unique index: 
&lt;BR /&gt;Gnenerally, the job will throws an java exception as below when you insert a duplicate row into table which have one or more columns are pk column. 
&lt;BR /&gt;Exception in component tMysqlOutput_1 
&lt;BR /&gt;com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 1 
&lt;BR /&gt;if you choose this action on data' insert or update on duplicate key or unique index', it will ignore the exception, if the pk column exists, update the non-pk columns, otherwise, insert new row. 
&lt;BR /&gt;Let's take an exmaple? 
&lt;BR /&gt;here is a table, id is a pk : 
&lt;BR /&gt;CREATE TABLE `person` ( 
&lt;BR /&gt; `id` int(11) NOT NULL, 
&lt;BR /&gt; `name` varchar(11) default NULL, 
&lt;BR /&gt; PRIMARY KEY (`id`) 
&lt;BR /&gt; ) ENGINE=MyISAM AUTO_INCREMENT=104 DEFAULT CHARSET=latin1 
&lt;BR /&gt;there are two rows in the table now: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;mike 
&lt;BR /&gt;2;shong 
&lt;BR /&gt;I will load the three rows as below into table: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;mike1 
&lt;BR /&gt;2;shong1 
&lt;BR /&gt;3;elise 
&lt;BR /&gt;result will be: 
&lt;BR /&gt;1;mike1 
&lt;BR /&gt;2;shong1 
&lt;BR /&gt;3;elise 
&lt;BR /&gt;2) Action On Data: Insert 
&lt;BR /&gt; Advanced settings: Check 'Use duplicate key update mode insert 
&lt;BR /&gt;it is similar with action on data 'insert or update on duplicate key or unique index', but there is a little difference, it will update the specified non-pk column with fixed value if the pk column exist. For exmaple 
&lt;BR /&gt;there are two rows in the table now: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;mike 
&lt;BR /&gt;2;shong 
&lt;BR /&gt;I will load the three rows as below into table: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;mike1 
&lt;BR /&gt;2;shong1 
&lt;BR /&gt;3;elise 
&lt;BR /&gt;I choose action on data 'insert' and check 'Use duplicate key update mode insert' option, specify a non-pk column with a fixed value as screenshot shows. 
&lt;BR /&gt;result will be: 
&lt;BR /&gt;id;name 
&lt;BR /&gt;1;a fixed value 
&lt;BR /&gt;2;a fixed value 
&lt;BR /&gt;3;elise 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; shong</description>
      <pubDate>Tue, 23 Feb 2010 10:10:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMysqlOutput-Action-on-Data-options/m-p/2375497#M137905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-23T10:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: tMysqlOutput 'Action on Data' options</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMysqlOutput-Action-on-Data-options/m-p/2375498#M137906</link>
      <description>&lt;FONT color="#2a2e2e"&gt;&lt;FONT size="2"&gt;Hi All,&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#2a2e2e"&gt;&lt;FONT size="2"&gt;I am using tDB2Input component to read data from one database and to save the data in another database, I use tDB2Output component. &lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#2a2e2e"&gt;&lt;FONT size="2"&gt;This job runs daily in Task Scheduler. There will be scenarios where New data should be Inserted and the already existing data in the destination database should be Updated.&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#2a2e2e"&gt;&lt;FONT size="2"&gt;So, I have used the Action on Data as 'Update or Insert' in my tDB2Output Component. But, the performace is very slow for this Action. But, If I am using Action on Data as 'Insert' for Insertion alone, the performance is good. What is the problem here? &lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#2a2e2e"&gt;&lt;FONT size="2"&gt;Kindly help me to resolve this Issue.&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT color="#2a2e2e"&gt;&lt;FONT size="2"&gt;Thanks,&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Fri, 12 Aug 2016 13:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMysqlOutput-Action-on-Data-options/m-p/2375498#M137906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-12T13:28:18Z</dc:date>
    </item>
  </channel>
</rss>

