<?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] MySQL last insert id in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266728#M45844</link>
    <description>Long-time lurker, first-time poster...&lt;BR /&gt;I'm having the same issue with virtually the same setup, though I don't have any compile problems in my job.  In my tMySqlLastInsertId_1 component, I have tMySqlConnection_1 in my "Link with" field and I'm using a built-in schema.  Any advice on this would be extremely helpful.</description>
    <pubDate>Fri, 05 Dec 2008 07:16:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-12-05T07:16:12Z</dc:date>
    <item>
      <title>[resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266726#M45842</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I try to use the tMysqlLastInsertId componant but I don't understand how to use it.&lt;BR /&gt;Description of the job I've made:&lt;BR /&gt;- Read a spreadsheet file&lt;BR /&gt;- Insert data into database&lt;BR /&gt;- Log id of inserted data&lt;BR /&gt;You can see a screenshot of my job in attachment.&lt;BR /&gt;The problem is that the autogenerated "Last_insert_id" column contains always the value "0" instead of the value of autoincrement.&lt;BR /&gt;Does anyone know how can I get the value of autoincrement ?&lt;BR /&gt;Thx in advance for your help.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 14:08:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266726#M45842</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266727#M45843</link>
      <description>Hi,&lt;BR /&gt;first you seem to have an error on your tMySQLOutput component (see red cross).&lt;BR /&gt;Despite this, in the db table, make sure your id is set to autoincrement.</description>
      <pubDate>Wed, 03 Dec 2008 22:17:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266727#M45843</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-03T22:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266728#M45844</link>
      <description>Long-time lurker, first-time poster...&lt;BR /&gt;I'm having the same issue with virtually the same setup, though I don't have any compile problems in my job.  In my tMySqlLastInsertId_1 component, I have tMySqlConnection_1 in my "Link with" field and I'm using a built-in schema.  Any advice on this would be extremely helpful.</description>
      <pubDate>Fri, 05 Dec 2008 07:16:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266728#M45844</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-05T07:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266729#M45845</link>
      <description>Hello milou
&lt;BR /&gt;Please see my screenshot.
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
      <pubDate>Fri, 05 Dec 2008 08:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266729#M45845</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-05T08:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266730#M45846</link>
      <description>Hello shong,
&lt;BR /&gt;I try to reproduce your example.
&lt;BR /&gt;See my screenshot.
&lt;BR /&gt;I've just replace the tRowGenerator componant by a tFileInputExcel.
&lt;BR /&gt;When I run the job, I see 2 problems:
&lt;BR /&gt;- I have value 0 instead of null for last_insert_id column in console.
&lt;BR /&gt;- If you look at the statistics, 20 rows have been inserted into database. 
&lt;BR /&gt;But only one row is displayed in console for last_insert_id...
&lt;BR /&gt;Do you know why ?
&lt;BR /&gt;Thx for your help.</description>
      <pubDate>Fri, 05 Dec 2008 09:43:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266730#M45846</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-05T09:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266731#M45847</link>
      <description>Hello
&lt;BR /&gt;Can you show us your table structure? Is there a column defined as auto_increment in your talbe?
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
      <pubDate>Sat, 06 Dec 2008 05:47:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266731#M45847</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-06T05:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266732#M45848</link>
      <description>Hi shong, 
&lt;BR /&gt;I've uploaded 2 screenshots: 
&lt;BR /&gt;- structure of my table (view from phpmyadmin) 
&lt;BR /&gt;- configuration of tMysqlOutput component (which insert value in my database) 
&lt;BR /&gt;You can see that my table has an autoincrement column as primary key.</description>
      <pubDate>Mon, 08 Dec 2008 10:05:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266732#M45848</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-08T10:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266733#M45849</link>
      <description>Hello milou 
&lt;BR /&gt;I have run my job again with a table created on phpmyadmin and it works fine. 
&lt;BR /&gt;Please send me your job via email. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; shong</description>
      <pubDate>Tue, 09 Dec 2008 02:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266733#M45849</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-09T02:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266734#M45850</link>
      <description>Hi shong, 
&lt;BR /&gt;I sent you my job by email this morning.</description>
      <pubDate>Tue, 09 Dec 2008 21:45:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266734#M45850</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-09T21:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266735#M45851</link>
      <description>Hi shong, 
&lt;BR /&gt;I update my job and found what it doesn't work: 
&lt;BR /&gt;I must check option "use an existing connection" in the tMysqlOutput component 
&lt;BR /&gt;and select the good tMysqlConnection in drop down list. 
&lt;BR /&gt;So it works ! 
&lt;BR /&gt;I get a not null last inserted id when I execute the job. 
&lt;BR /&gt;But if the job insert more than one row in my table, I only get the inserted id for the last row. 
&lt;BR /&gt;How can I get the id for each row ? 
&lt;BR /&gt;It is possible ?</description>
      <pubDate>Wed, 10 Dec 2008 08:44:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266735#M45851</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-10T08:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266736#M45852</link>
      <description>Hello 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;How can I get the id for each row ?&lt;BR /&gt;It is possible ?&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Yes, we can get all the new inserted id. There is a global variable can be used to get the first new inserted id: 
&lt;BR /&gt;tMysqlOutput_1_NB_LINE: the total number of new inserted rows. 
&lt;BR /&gt;For more information, please see my screenshots. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; shong</description>
      <pubDate>Thu, 11 Dec 2008 03:15:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266736#M45852</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-11T03:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266737#M45853</link>
      <description>Hi shong,
&lt;BR /&gt;I will test your solution asap.
&lt;BR /&gt;Many thanks for your help.</description>
      <pubDate>Thu, 11 Dec 2008 08:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266737#M45853</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-11T08:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266738#M45854</link>
      <description>Hi shong, 
&lt;BR /&gt;I'm very happy to say it works very well !! 
&lt;BR /&gt;But I've just changed a component in your example to make it working for me. 
&lt;BR /&gt;My table contains 50 lines and has been truncated sometimes. 
&lt;BR /&gt;The value of id for "autoincrement" column is different from the line number. 
&lt;BR /&gt;Example: 
&lt;BR /&gt;Line 1: id=8810 
&lt;BR /&gt;Line 2: id=8811 
&lt;BR /&gt;... 
&lt;BR /&gt;When I execute the job, I can see in output: 
&lt;BR /&gt;first insert id: 8820 
&lt;BR /&gt;last insert id: 8839 
&lt;BR /&gt;tsampleRow expression: 8820..8839 
&lt;BR /&gt;And no line are displayed in the tLogRow componant. 
&lt;BR /&gt;I known why: tSampleRow filters on line number, not on value. 
&lt;BR /&gt;So it will filter from line 8820 to line 8839. 
&lt;BR /&gt;And I want to filter from value 8820 to value 8839. 
&lt;BR /&gt;I've just replaced tSampleRow by tFilterRow and put this condition: 
&lt;BR /&gt;myAutoIncrementColumn &amp;gt;= context.firstInsertID and myAutoIncrementColumn &amp;lt;= context.lastInsertID 
&lt;BR /&gt;and I've the list of id previously inserted. 
&lt;BR /&gt;Thx for your help and time. 
&lt;BR /&gt;I hope we keep in touch ... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 11 Dec 2008 13:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266738#M45854</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-11T13:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266739#M45855</link>
      <description>Hi together,&lt;BR /&gt;maybe I missed one point. But to get the "lastInsertedId" for each row you could just change the "onSubJobOk" and just continue in the data flow.&lt;BR /&gt;Bye&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 16 Dec 2008 20:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266739#M45855</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-12-16T20:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266740#M45856</link>
      <description>This solution does not work in a concurrent access environment !
&lt;BR /&gt;any other db client could have inserted any identity value in the meantime.
&lt;BR /&gt;could it be possible to modify all sql output component so to gain access to the identity column in a extra schema field ?</description>
      <pubDate>Thu, 05 Mar 2009 12:58:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266740#M45856</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-03-05T12:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266741#M45857</link>
      <description>Hello, 
&lt;BR /&gt;I've got the same problem. When I try the example that illustrates tMysqlLastInsertId or your example, I only retrieve the same identifier 100 times. In my opinion, the job cannot retrieve the last identifier created by autoincrement when it's in the same transaction than insertion in Talend for Mysql, unlike the last_insert_id() of mysql wich works unitary. 
&lt;BR /&gt;.------------------------------. 
&lt;BR /&gt;| #1. tLogRow_2 | 
&lt;BR /&gt;+----------------+-------------+ 
&lt;BR /&gt;| key | value | 
&lt;BR /&gt;+----------------+-------------+ 
&lt;BR /&gt;| id | 0 | 
&lt;BR /&gt;| nom | Jean-Michel | 
&lt;BR /&gt;| last_insert_id | 0 | 
&lt;BR /&gt;+----------------+-------------+ 
&lt;BR /&gt;.---------------------------------. 
&lt;BR /&gt;| #2. tLogRow_2 | 
&lt;BR /&gt;+----------------+----------------+ 
&lt;BR /&gt;| key | value | 
&lt;BR /&gt;+----------------+----------------+ 
&lt;BR /&gt;| id | 0 | 
&lt;BR /&gt;| nom | Jean-Micheline | 
&lt;BR /&gt;| last_insert_id | 0 | 
&lt;BR /&gt;+----------------+----------------+ 
&lt;BR /&gt;last id inserted retrieve after commit: 
&lt;BR /&gt;14|Jean-Micheline 
&lt;BR /&gt;This problem seems to be pretty old: 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCsiyCAC" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Archive/Get-the-LAST-INSERT-ID-in-auto-increment-field/td-p/59074&lt;/A&gt;</description>
      <pubDate>Mon, 03 Aug 2009 10:54:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266741#M45857</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2009-08-03T10:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266742#M45858</link>
      <description>Hey guys.  I have something similar going on and I think I found another solution to the problem.  Let's say I was inserting 3 rows.  After inserting said rows let's say their newly inserted IDs are 11, 12, and 13.  Upon using logrow to see what was being retrieved by the lastinsertid component I would see the new insert ids 0, 11, and 12.&lt;BR /&gt;I fixed this problem by adding a "mysqlcommit" component between the output component and the lastinsertid component with the option to disconnect the session turned off.  Upon making this change, the lastinsertids came back accurately.  This really is NOT an optimal solution for the problem as I have to do a commit for the connection, which may not be optimal depending on what it is you're trying to achieve.</description>
      <pubDate>Wed, 21 Sep 2011 17:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266742#M45858</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-21T17:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266743#M45859</link>
      <description>Hi all,&lt;BR /&gt;I had the same issue (having the insert into a table, retrieve the id and use it in the rest of the treatment).&lt;BR /&gt;Instead of having to define a tConnection + tCommit + tLastInserteId + all subjobs + (...) , I've simply used a &lt;BR /&gt;Numeric.sequence in the tMap variable. I first retrieve the last index of the table I want to insert into and&lt;BR /&gt;add to this index the Numeric.sequence. The new index can be used therafter and works for each row (no &lt;BR /&gt;need to insert all and then retrieve all).&lt;BR /&gt;This might not solve eveybody's problem but hopefully it should help some.&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 12 Jun 2012 14:39:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266743#M45859</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-12T14:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] MySQL last insert id</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266744#M45860</link>
      <description>Hi all,&lt;BR /&gt;If you use this component with tMySqlOutput, verify that the Extend Insert check box&lt;BR /&gt;in the Advanced Settings tab is not selected. Extend Insert allows you to make a batch&lt;BR /&gt;insertion, however, if the check box is selected, only the ID of the last line in the last&lt;BR /&gt;batch will be returned.&lt;BR /&gt;I think this will help you people&lt;BR /&gt;Thank you</description>
      <pubDate>Wed, 23 Jul 2014 08:04:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-MySQL-last-insert-id/m-p/2266744#M45860</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-07-23T08:04:13Z</dc:date>
    </item>
  </channel>
</rss>

