PDA

View Full Version : db lookup for last insert id using mysql



efanti
01-21-2009, 09:59 AM
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.

MattCasters
01-21-2009, 10:25 AM
Yes you can. There is an option in the "Table Output" step to do it.

efanti
01-27-2009, 02:43 AM
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 ?

MattCasters
01-27-2009, 04:32 AM
Try the "Combination Lookup" step

roms
07-27-2011, 01:56 AM
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