Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Attached is the image of what I am trying to do, I need to add a line from tMap1 to tJoin1 but I am not allowed to.
Hello
I sorry to say that there are some design error in your job.
In Talend, you are not allowed to create a cycle flow in a job, see 1468.
About how to use tMysqlLastInsertId component, see 4895.
In the latter case this is useless, but if it is capable of returning ALL the inserted IDs from previous job, how do I match those Ids to the original data??
Hello
In the latter case this is useless, but if it is capable of returning ALL the inserted IDs from previous job, how do I match those Ids to the original data??
It only returns the last inserted id, not all the new inserted ids. About your request, can you take an exmaple with some data? What's the data looks like in OLDDATA table and what are your expected result?
Best regards
shong
mysql> select * from SOURCE ORDER id;
+----+--------+-----------+-----------+-----------+-------------------------------------------------------------+
| id | name | prop1 | prop2 | prop3 | description |
+----+--------+-----------+-----------+-----------+-------------------------------------------------------------+
| 1 | Item 1 | i1_p1_val | i1_p2_val | i1_p3_val | |
| 2 | Item 2 | i2_p1_val | i2_p2_val | i2_p3_val | |
| 3 | Item 3 | i3_p1_val | i3_p2_val | i3_p3_val | |
| 4 | Item 3 | i4_p1_val | i2_p2_val | i1_p3_val | This Item has same name and some prop values as other items |
+----+--------+-----------+-----------+-----------+-------------------------------------------------------------+
mysql> select * from TARGET_ITEMS ORDER BY item_id;
+---------+---------------------+
| item_id | item |
+---------+---------------------+
| 1 | Existing new Item 1 |
| 2 | Existing new item 2 |
+---------+---------------------+
mysql> select * from TARGET_PROPS ORDER BY prop_id;
+---------+---------+-----------+---------------------------------------+
| prop_id | item_id | prop_name | prop_value |
+---------+---------+-----------+---------------------------------------+
| 1 | 1 | prop3 | |
| 2 | 2 | prop2 | Prop2 Value - Prop1 and 3 are not set |
| 3 | 2 | Source | newapp |
| 4 | 1 | prop1 | Prop1 value |
| 5 | 1 | Source | newapp |
+---------+---------+-----------+---------------------------------------+
mysql> select * from TARGET_ITEMS ORDER BY item_id;
+---------+---------------------+
| item_id | item |
+---------+---------------------+
| 1 | Existing new Item 1 |
| 2 | Existing new item 2 |
| 3 | Item 3 |
| 4 | Item 2 |
| 5 | Item 1 |
| 6 | Item 3 |
+---------+---------------------+
6 rows in set (0.00 sec)
mysql> select * from TARGET_PROPS ORDER BY prop_id;
+---------+---------+-----------+---------------------------------------+
| prop_id | item_id | prop_name | prop_value |
+---------+---------+-----------+---------------------------------------+
| 1 | 1 | prop3 | |
| 2 | 2 | prop2 | Prop2 Value - Prop1 and 3 are not set |
| 3 | 2 | Source | newapp |
| 4 | 1 | prop1 | Prop1 value |
| 5 | 1 | Source | newapp |
| 6 | 3 | prop1 | i3_p1_val |
| 7 | 4 | prop1 | i2_p1_val |
| 8 | 5 | prop1 | i1_p1_val |
| 9 | 6 | prop1 | i4_p1_val |
| 10 | 3 | prop2 | i3_p2_val |
| 11 | 4 | prop2 | i2_p2_val |
| 12 | 5 | prop2 | i1_p2_val |
| 13 | 6 | prop2 | i2_p2_val |
| 14 | 3 | prop3 | i3_p3_val |
| 15 | 4 | prop3 | i2_p3_val |
| 16 | 5 | prop3 | i1_p3_val |
| 17 | 6 | prop3 | i1_p3_val |
+---------+---------+-----------+---------------------------------------+
Hello guy
I have sent a demo job to you, if you don't receive a email from me, please send me a email.