<?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 Weird Error : Duplicate entry 'Key Value' for key 'PRIMARY' in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345116#M112691</link>
    <description>&lt;P&gt;Hello Guys,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Could you please help?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Problem Description :&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;'Reject' component of tMysqlOutput is triggered even when there is &amp;nbsp;no rejected row.The row mentioned as rejected in console log is actually inserted.&lt;BR /&gt;In my Sub job i send an email whenever a row is rejected &amp;nbsp;and because of above issue , a false email notification is sent even when there is no rejected row.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Details : &amp;nbsp;&lt;/P&gt; 
&lt;P&gt;MySql Server : 5.7.11&lt;/P&gt; 
&lt;P&gt;Talend Open Studio : &amp;nbsp;6.1.1&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a job, which inserts data from Excel files stored in a folder to Mysql table.I capture the 'Reject' trigger and notify the user about the rejected row.I am getting&amp;nbsp;Duplicate entry 'Key Value' for key 'PRIMARY' error only when last file of the folder is processed.Mysql table has a Primary Key which consists of 3 columns.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Data is loaded into a staging table which is always cleared before loading. Basically it is a false error as the sub job inserts all the data from excel. What i noticed is that the error message always contains the primary key from the first row inserted.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Below are tlogrow output and error msg.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For input string: "Investor_id"&lt;BR /&gt;Audi_Inv|750|Infosys|We|B|1297|23/12/2015|530|It_Funds_US|0.63|1&lt;BR /&gt;Audi_Inv|750|Infosys|We|B|1102|05/12/2015|536|It_Funds_Asia|0.52|13&lt;BR /&gt;Audi_Inv|750|Infosys|We|B|1169|25/12/2015|542|It_Funds_US|0.6|11&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1273|03/12/2015|560|It_Funds_APAC|0.1|2&lt;BR /&gt;&lt;STRONG&gt;Audi_Inv|750|TCS|We|B|1127|01/12/2015|572|It_Funds_Asia|0.52|0&lt;/STRONG&gt;&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1250|01/12/2015|596|It_Funds_US|0.32|1&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1260|29/12/2015|620|It_Funds_APAC|0.13|2&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1026|18/12/2015|626|It_Funds_US|0.27|11&lt;BR /&gt;Audi_Inv|750|IBM|We|B|1134|04/12/2015|632|It_Funds_New|0.1|5&lt;BR /&gt;Audi_Inv|750|TechnoCr|We|S|1187|21/12/2015|698|It_Funds_APAC|0.51|-2&lt;BR /&gt;Audi_Inv|750|TechnoCr|We|S|1007|02/12/2015|704|It_Funds|0.32|7&lt;BR /&gt;Audi_Inv|750|TechnoCr|We|B|1059|28/12/2015|728|It_Funds_New|0.36|4&lt;BR /&gt;Audi_Inv|750|TechnoCr|We|B|1070|12/12/2015|734|It_Funds_New|0.24|4&lt;BR /&gt;Audi_Inv|750|GenX|We|S|1016|26/12/2015|746|It_Funds_APAC|0.58|7&lt;BR /&gt;Audi_Inv|750|GenX|We|B|1258|01/12/2015|770|It_Funds_US|0.31|10&lt;BR /&gt;Audi_Inv|750|GenX|We|S|1176|13/12/2015|776|It_Funds_Asia|0.35|-2&lt;BR /&gt;Audi_Inv|750|GenX|We|S|1255|25/12/2015|782|It_Funds_US|0.43|-7&lt;BR /&gt;Audi_Inv|750|GenX|We|B|1079|06/12/2015|788|It_Funds_New|0.66|-6&lt;BR /&gt;Audi_Inv|750|Sonata|We|S|1020|25/12/2015|830|It_Funds_Asia|0.58|13&lt;BR /&gt;Audi_Inv|750|Sonata|We|B|1285|30/12/2015|836|It_Funds_US|0.38|-4&lt;BR /&gt;Audi_Inv|750|Sonata|We|B|1011|09/12/2015|854|It_Funds|0.52|5&lt;BR /&gt;Audi_Inv|750|TechM|We|B|1224|10/12/2015|878|It_Funds|0.64|-7&lt;BR /&gt;Audi_Inv|750|TechM|We|B|1174|26/12/2015|896|It_Funds_New|0.68|1&lt;BR /&gt;Audi_Inv|750|Infosys|We|S|1244|22/12/2015|956|It_Funds_US|0.44|10&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1084|29/12/2015|998|It_Funds|0.3|-2&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1078|21/12/2015|1004|It_Funds|0.38|5&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1163|03/12/2015|1028|It_Funds|0.42|8&lt;BR /&gt;Audi_Inv|750|IBM|We|B|1282|06/12/2015|1040|It_Funds|0.2|-5&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1223|24/12/2015|1046|It_Funds_APAC|0.64|13&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1227|25/12/2015|1058|It_Funds_US|0.17|8&lt;BR /&gt;Audi_Inv|750|IBM|We|B|1182|12/12/2015|1076|It_Funds_Asia|0.25|-4&lt;BR /&gt;Audi_Inv|750|IBM|We|B|1140|15/12/2015|1082|It_Funds_US|0.4|13&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1102|26/12/2015|1088|It_Funds_US|0.29|3&lt;BR /&gt;Duplicate entry &lt;STRONG&gt;'2015-12-01-572-We'&lt;/STRONG&gt; for key 'PRIMARY'.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am attaching job screenshots as well.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Keys defined.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lva2.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147259iE1716D694BA5F265/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lva2.png" alt="0683p000009Lva2.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sub job.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LvdK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140725iE3B6B7AACF4E28BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LvdK.png" alt="0683p000009LvdK.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Bhagwati&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Jul 2017 22:01:42 GMT</pubDate>
    <dc:creator>Bhagwati1</dc:creator>
    <dc:date>2017-07-23T22:01:42Z</dc:date>
    <item>
      <title>Weird Error : Duplicate entry 'Key Value' for key 'PRIMARY'</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345116#M112691</link>
      <description>&lt;P&gt;Hello Guys,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Could you please help?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Problem Description :&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;'Reject' component of tMysqlOutput is triggered even when there is &amp;nbsp;no rejected row.The row mentioned as rejected in console log is actually inserted.&lt;BR /&gt;In my Sub job i send an email whenever a row is rejected &amp;nbsp;and because of above issue , a false email notification is sent even when there is no rejected row.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Details : &amp;nbsp;&lt;/P&gt; 
&lt;P&gt;MySql Server : 5.7.11&lt;/P&gt; 
&lt;P&gt;Talend Open Studio : &amp;nbsp;6.1.1&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a job, which inserts data from Excel files stored in a folder to Mysql table.I capture the 'Reject' trigger and notify the user about the rejected row.I am getting&amp;nbsp;Duplicate entry 'Key Value' for key 'PRIMARY' error only when last file of the folder is processed.Mysql table has a Primary Key which consists of 3 columns.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Data is loaded into a staging table which is always cleared before loading. Basically it is a false error as the sub job inserts all the data from excel. What i noticed is that the error message always contains the primary key from the first row inserted.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Below are tlogrow output and error msg.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For input string: "Investor_id"&lt;BR /&gt;Audi_Inv|750|Infosys|We|B|1297|23/12/2015|530|It_Funds_US|0.63|1&lt;BR /&gt;Audi_Inv|750|Infosys|We|B|1102|05/12/2015|536|It_Funds_Asia|0.52|13&lt;BR /&gt;Audi_Inv|750|Infosys|We|B|1169|25/12/2015|542|It_Funds_US|0.6|11&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1273|03/12/2015|560|It_Funds_APAC|0.1|2&lt;BR /&gt;&lt;STRONG&gt;Audi_Inv|750|TCS|We|B|1127|01/12/2015|572|It_Funds_Asia|0.52|0&lt;/STRONG&gt;&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1250|01/12/2015|596|It_Funds_US|0.32|1&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1260|29/12/2015|620|It_Funds_APAC|0.13|2&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1026|18/12/2015|626|It_Funds_US|0.27|11&lt;BR /&gt;Audi_Inv|750|IBM|We|B|1134|04/12/2015|632|It_Funds_New|0.1|5&lt;BR /&gt;Audi_Inv|750|TechnoCr|We|S|1187|21/12/2015|698|It_Funds_APAC|0.51|-2&lt;BR /&gt;Audi_Inv|750|TechnoCr|We|S|1007|02/12/2015|704|It_Funds|0.32|7&lt;BR /&gt;Audi_Inv|750|TechnoCr|We|B|1059|28/12/2015|728|It_Funds_New|0.36|4&lt;BR /&gt;Audi_Inv|750|TechnoCr|We|B|1070|12/12/2015|734|It_Funds_New|0.24|4&lt;BR /&gt;Audi_Inv|750|GenX|We|S|1016|26/12/2015|746|It_Funds_APAC|0.58|7&lt;BR /&gt;Audi_Inv|750|GenX|We|B|1258|01/12/2015|770|It_Funds_US|0.31|10&lt;BR /&gt;Audi_Inv|750|GenX|We|S|1176|13/12/2015|776|It_Funds_Asia|0.35|-2&lt;BR /&gt;Audi_Inv|750|GenX|We|S|1255|25/12/2015|782|It_Funds_US|0.43|-7&lt;BR /&gt;Audi_Inv|750|GenX|We|B|1079|06/12/2015|788|It_Funds_New|0.66|-6&lt;BR /&gt;Audi_Inv|750|Sonata|We|S|1020|25/12/2015|830|It_Funds_Asia|0.58|13&lt;BR /&gt;Audi_Inv|750|Sonata|We|B|1285|30/12/2015|836|It_Funds_US|0.38|-4&lt;BR /&gt;Audi_Inv|750|Sonata|We|B|1011|09/12/2015|854|It_Funds|0.52|5&lt;BR /&gt;Audi_Inv|750|TechM|We|B|1224|10/12/2015|878|It_Funds|0.64|-7&lt;BR /&gt;Audi_Inv|750|TechM|We|B|1174|26/12/2015|896|It_Funds_New|0.68|1&lt;BR /&gt;Audi_Inv|750|Infosys|We|S|1244|22/12/2015|956|It_Funds_US|0.44|10&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1084|29/12/2015|998|It_Funds|0.3|-2&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1078|21/12/2015|1004|It_Funds|0.38|5&lt;BR /&gt;Audi_Inv|750|TCS|We|S|1163|03/12/2015|1028|It_Funds|0.42|8&lt;BR /&gt;Audi_Inv|750|IBM|We|B|1282|06/12/2015|1040|It_Funds|0.2|-5&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1223|24/12/2015|1046|It_Funds_APAC|0.64|13&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1227|25/12/2015|1058|It_Funds_US|0.17|8&lt;BR /&gt;Audi_Inv|750|IBM|We|B|1182|12/12/2015|1076|It_Funds_Asia|0.25|-4&lt;BR /&gt;Audi_Inv|750|IBM|We|B|1140|15/12/2015|1082|It_Funds_US|0.4|13&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1102|26/12/2015|1088|It_Funds_US|0.29|3&lt;BR /&gt;Duplicate entry &lt;STRONG&gt;'2015-12-01-572-We'&lt;/STRONG&gt; for key 'PRIMARY'.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am attaching job screenshots as well.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Keys defined.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lva2.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147259iE1716D694BA5F265/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lva2.png" alt="0683p000009Lva2.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sub job.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LvdK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140725iE3B6B7AACF4E28BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LvdK.png" alt="0683p000009LvdK.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Bhagwati&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 22:01:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345116#M112691</guid>
      <dc:creator>Bhagwati1</dc:creator>
      <dc:date>2017-07-23T22:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Error : Duplicate entry 'Key Value' for key 'PRIMARY'</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345117#M112692</link>
      <description>Hello 
&lt;BR /&gt;Duplicate entry '2015-12-01-572-We' for key 'PRIMARY', it is duplicated entry . You are iterating multiple files, there must exist same entry '2015-12-01-572-We', only the first entry '2015-12-01-572-We' will be inserted into db, other duplicated entry will be rejected. For testing, you can unite all records before inserting, and use a tUniqRow to get the unique records and duplicated records, eg..
&lt;BR /&gt;....tMap1--tUnite--tUniqRow--duplicated--tLogRow2
&lt;BR /&gt;
&lt;BR /&gt;Check if tLogRows has records output.
&lt;BR /&gt;
&lt;BR /&gt;Regards
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 24 Jul 2017 03:39:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345117#M112692</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-24T03:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Error : Duplicate entry 'Key Value' for key 'PRIMARY'</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345118#M112693</link>
      <description>&lt;P&gt;Hi Shong,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to notify the client whenever a duplicate row is received in the same file. And this can not be achieved if i use the approach you suggested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now back to the the query i raised, There are 2 things,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.Table is blank while inserting the records, &amp;nbsp;So it is impossible that the error is raised because primary key constraint was violated.&lt;/P&gt;
&lt;P&gt;2.The row which is shown as duplicated /rejected is actually inserted into the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bhagwati&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 21:28:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345118#M112693</guid>
      <dc:creator>Bhagwati1</dc:creator>
      <dc:date>2017-07-24T21:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Error : Duplicate entry 'Key Value' for key 'PRIMARY'</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345119#M112694</link>
      <description>Hi 
&lt;BR /&gt;1. If there exists duplicated entry, the error will be raised and the duplicated entry will be rejected, this is the normal situation, why you said it is impossible?
&lt;BR /&gt;2. The unique entry will be inserted, the duplicated entry will be rejected. For example, assuming the input data are:
&lt;BR /&gt;Audi_Inv|750|TCS|We|B|1127|01/12/2015|572|It_Funds_Asia|0.52|0
&lt;BR /&gt;Audi_Inv|750|TCS|We|B|1250|01/12/2015|572|It_Funds_US|0.32|1
&lt;BR /&gt;Audi_Inv|750|IBM|We|S|1260|29/12/2015|620|It_Funds_APAC|0.13|2
&lt;BR /&gt;The first line and the second line have the same primary key '2015-12-01-572-We', after you execute the job, the first line and the third line will be inserted into DB, the second line will be rejected. 
&lt;BR /&gt;
&lt;BR /&gt;Regards
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 25 Jul 2017 11:20:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345119#M112694</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-25T11:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Error : Duplicate entry 'Key Value' for key 'PRIMARY'</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345120#M112695</link>
      <description>&lt;P&gt;Thanks Shong.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 06:14:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-Error-Duplicate-entry-Key-Value-for-key-PRIMARY/m-p/2345120#M112695</guid>
      <dc:creator>Bhagwati1</dc:creator>
      <dc:date>2017-08-02T06:14:30Z</dc:date>
    </item>
  </channel>
</rss>

