Mysql output and Tmap

One Star

Mysql output and Tmap

Hello,
I'm using Talend and i'm getting stuck in a small problem :
- I have 2 table in input
- I have 2 table in output
- The second table in output need the id of the first output table (IS_REFERENCE) and one data from the input table (code_barre).
I get the code_barre without problem, but i can't get the IS_REFERENCE.
Community Manager

Re: Mysql output and Tmap

Hi
From your screenshot, I see that you do nothing for IS_REFERENCE column.
You can type in: Numeric.sequence("s1",1,1) for IS_REFERENCE column of the first output table and type in: Numeric.sequence("s2",1,1) for IS_REFERENCE column of the second output table.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Mysql output and Tmap

This is an auto increment field, i don't have to set a value (and the table already contain data).
And the problem is that i will have to do update or create : so i want to get this value.
One Star

Re: Mysql output and Tmap

This is an auto increment field, i don't have to set a value (and the table already contain data).
And the problem is that i will have to do update or create : so i want to get this value.

I found a way to do it! Maybe this is not the cleanest solution but it worked for me, here is what I did
1. I created a Job to load the data for the parent table (with just one mysql input and one mysql output)
2. I created a Job to load the data for the child table, but in this case I needed to add two mysql inputs, one for the parent table and one for the child table, in the map component is where I made the join between these two tables, then I just put in the output table the fields that I needed from the child table and the unique id from the parent table
It's kind of confusing but I hope I made my point clear, if you didn't understand what I did you can contact me or post your doubts here Smiley Happy