Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Amine5
Contributor
Contributor

Map foreign keys in a tMap component

Hi,

I'm new to Talend Studio for Data Integration, and i would like to link entities using a tMap. Here my scenario:

I have a Table A and a Table B. Both of them have their Ids (no other field, let's keep it simple).

Then, using a tmap, i want to create a new table, that contains both of Table A and Table B's id. Let's call it Table C. It'll then look like this:

Table A

--------

id

--------

 

Table B

--------

id

--------

 

Table C

--------

id_a

id_b

--------

 

My problem is, the ids in my Table C are primary keys only, but i want them to be foreign keys as well. How can i achieve that ?

Thank you

Labels (4)
1 Solution

Accepted Solutions
gjeremy1617088143

you have to set constraints in your database, if you want to do it via talend you have to execute the sql script of constraints creation via tDBRow component after the creation of the table.

View solution in original post

4 Replies
gjeremy1617088143

Hi, you have just to check the key checkbox in the schema for the column you want in the output, talend will handle it with your db.

Send me Love and Kudos

Amine5
Contributor
Contributor
Author

Hi, thanks for your answer.

I already did this, it's done automatically when i map the columns. But in my database the constraints are not set, the keys in Table C are just declared as primary keys, not as foreign keys, there is no real link between tables.

gjeremy1617088143

you have to set constraints in your database, if you want to do it via talend you have to execute the sql script of constraints creation via tDBRow component after the creation of the table.

Amine5
Contributor
Contributor
Author

Thank you very much !