Get LastInsert ID for each rows in main

Five Stars

Get LastInsert ID for each rows in main

Hi,
Here's a part of my schema

talend.PNG

 

 

Both LastInsertId return or :
- The last one ID

- A previously commited object id

I want my id, like 1 -> 2 -> 3 etc...

Thanks !

Eleven Stars

Re: Get LastInsert ID for each rows in main

I think you do not have to commit first. link yout commit with an on subjob Ok

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Five Stars

Re: Get LastInsert ID for each rows in main

I do not have possibility to add "on subjob ok" neither on DBOutput nor XMLMap
Eleven Stars

Re: Get LastInsert ID for each rows in main

on subjog OK are allowed only on first component of the subjob . (green background)

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Five Stars

Re: Get LastInsert ID for each rows in main

If I do that I will lost the information I need in main flux
Eleven Stars

Re: Get LastInsert ID for each rows in main

I do not think so. Try and sea.
Using lastInsertedId in an open transation alow you to use last Id as reference in an other Table.
if you have a complex insert procedure just Writ an SQL Procedure and call it from Talend.
by this way you can use this Insert Procedure manually or with an other soft.
Regards,

Francois Denis

Tag as "solved" for others! Kudos to thanks!