<?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 How to get last inserted primary key mysql database in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353031#M119301</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt; 
&lt;P&gt;I'm tryring to store old data into mysqql database from csv files,&lt;BR /&gt;I have two tables mother and Daughter, both have auto_increment id:&lt;/P&gt; 
&lt;P&gt;table 1 : id, fname, lname .. etc&lt;/P&gt; 
&lt;P&gt;table 2 : id, id_table1&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;after storing a row in table1 I should store it's primary key in table2.&lt;/P&gt; 
&lt;P&gt;In the photo below table1 is "responsable" and table2 is "agent_suivi"&lt;/P&gt; 
&lt;P&gt;the method&amp;nbsp;"Select Last_Insert_id()" didn't work for me because I don't have other attributes to store I have only the id of the table mother , so using the map directly requires at least one column to link between tmap and tmysqloutput.&lt;BR /&gt;How can I do it?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 08:11:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T08:11:47Z</dc:date>
    <item>
      <title>How to get last inserted primary key mysql database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353031#M119301</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt; 
&lt;P&gt;I'm tryring to store old data into mysqql database from csv files,&lt;BR /&gt;I have two tables mother and Daughter, both have auto_increment id:&lt;/P&gt; 
&lt;P&gt;table 1 : id, fname, lname .. etc&lt;/P&gt; 
&lt;P&gt;table 2 : id, id_table1&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;after storing a row in table1 I should store it's primary key in table2.&lt;/P&gt; 
&lt;P&gt;In the photo below table1 is "responsable" and table2 is "agent_suivi"&lt;/P&gt; 
&lt;P&gt;the method&amp;nbsp;"Select Last_Insert_id()" didn't work for me because I don't have other attributes to store I have only the id of the table mother , so using the map directly requires at least one column to link between tmap and tmysqloutput.&lt;BR /&gt;How can I do it?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 08:11:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353031#M119301</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T08:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last inserted primary key mysql database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353032#M119302</link>
      <description>&lt;P&gt;Is this something what could work?&lt;/P&gt;
&lt;PRE&gt;SELECT `AUTO_INCREMENT`
FROM  INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'DatabaseName'
AND   TABLE_NAME   = 'TableName';&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 22:04:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353032#M119302</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-05-29T22:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last inserted primary key mysql database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353033#M119303</link>
      <description>&lt;P&gt;I don't know how to use it.&lt;/P&gt; 
&lt;P&gt;Actually, I'm blocked between the "tMysqlOutput" of the table mother and the "tMysqlInput" of the other table in which I want insert the last inserted ID in the table mother&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture3.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LykO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151556i0AFC82898F1DC24D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LykO.png" alt="0683p000009LykO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;My question is how to link between these two components and store the id retrieved from the first one to the second?&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 11:36:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353033#M119303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-30T11:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last inserted primary key mysql database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353034#M119304</link>
      <description>Why not create a second responsable out from tMap_1 and define your own prim_key.&lt;BR /&gt;Does it need to be auto_increment, you could use a talend increment function in tMap by using the routines.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 30 May 2018 12:11:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353034#M119304</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-05-30T12:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last inserted primary key mysql database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353035#M119305</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to use tmysqllastinsertid component to bring last inserted value for next step. I have attached component image also&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope it will help to resolve ur problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked for mssql same kind of component worked fine.&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;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LsS1"&gt;tmysqllastinsertid.JPG&lt;/A&gt;</description>
      <pubDate>Wed, 30 May 2018 12:14:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353035#M119305</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-30T12:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last inserted primary key mysql database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353036#M119306</link>
      <description>&lt;P&gt;I used the "tMysqlLastInsertedId" and it worked&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you for your help.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture4.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lycf.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139211iF14CFE4A4BE38D88/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lycf.png" alt="0683p000009Lycf.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 12:33:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-get-last-inserted-primary-key-mysql-database/m-p/2353036#M119306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-30T12:33:19Z</dc:date>
    </item>
  </channel>
</rss>

