US and Worldwide: +1 (866) 660-7555
Results 1 to 5 of 5

Thread: db lookup for last insert id using mysql

  1. #1
    Join Date
    Jan 2009
    Posts
    5

    Default db lookup for last insert id using mysql

    Hi all.

    I woul like if it's possible this.

    I would like to have a transformation of this type:


    insert a record in a table (where insert_id is a auto incremental value)

    In the following step, I have to insert a record into another table where a field refers to the value previously entered inssert_id.

    In mysql db exist this command "select last_insert_id".

    The SELECT returns the auto increment value generated during the last INSERT.

    can I have this?

    Thank you.

  2. #2
    Join Date
    Nov 1999
    Posts
    9,688

    Default

    Yes you can. There is an option in the "Table Output" step to do it.
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence
    http://www.pentaho.org -- mcasters@pentaho.org

    Author of the book Pentaho Kettle Solutions by Wiley. Also available as e-Book and on the Kindle reading applications (iPhone, iPad, Android, Kindle devices, ...)

    Join us on IRC server Freenode.net, channel ##pentaho

  3. #3
    Join Date
    Jan 2009
    Posts
    5

    Default

    Hi.

    I tried.

    With "Table Output" step, first I have to remove some filed to insert in table specified in this step, because I can not specify the fields you need to add a line on the table.

    But if after this step, I need the fields that I have removed? I have no more available.

    Can you help me ?

  4. #4
    Join Date
    Nov 1999
    Posts
    9,688

    Default

    Try the "Combination Lookup" step
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence
    http://www.pentaho.org -- mcasters@pentaho.org

    Author of the book Pentaho Kettle Solutions by Wiley. Also available as e-Book and on the Kindle reading applications (iPhone, iPad, Android, Kindle devices, ...)

    Join us on IRC server Freenode.net, channel ##pentaho

  5. #5

    Default

    I'm sorry, I can see this post if very old, but have you found a solution for this? I have exactly the same problem..

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •