Mapping FK into a table in talend

十年热恋 提交于 2019-12-08 09:12:18

问题


I have 2 entities in my schema. I mapped one already and now for the second one I need to also have the PK of the first entity as a FK in the second entity when mapping using talend. They are both in the same job, but how can I use the Pk of the first entity in the mapping of the second entity?

enter image description here

This is what I have so far (row1 is entity1 which has an autogenerated key inside the tmap)

row2 is creating csv from xml file row3 maps the csv file generated from row2, however it should have a fk from entity 1 that is from row1


回答1:


In the tMap_1, create another output row and write the auto generated ID's to a CSV using a tfileOutputDelimeted component. In your tMap_2, lookup this CSV file with the auto generated ID's and write to the table.



来源:https://stackoverflow.com/questions/55000217/mapping-fk-into-a-table-in-talend

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!