Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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
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.
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.
Thank you very much !