Toad World® Forums

n:m relationship for tables with shared key attributes


#1

TDM 3.3.8.11

What is the proper way to create a new n:m relationship between two tables when the tables both share some common key attributes that are not a part of the rest of the schema? For example:

Entity: shipment_slice - PK attributes are:
order_id
product_id
address_id
file_id
segment_code
mailkey_code

Entity: post_fulfillment_slice - PK attributes are:
order_id
product_id
parm_id
file_id
segment_code
mailkey_code

Some of the common columns have their original in the PK of other entities (like order_id, product_id). However, the file_id, segment_code, and mailkey_code only exist in these two entities above.

When creating a n:m relationship, TDM will correctly consolidate order_id and product_id, so that they only appear once in the join entity. It also correctly adds the address_id and parm_id attributes from shipment_slice and post_fulfillment_slice, respectively.

However, the other attributes that are common (file_id, segment_code, and mailkey_code mentioned above) are duplicated in the join table. I do not see any way to manually fix this either (ie. tell TDM that the file_id on the left is the same as the one on the right).


#2

Hi,

Please check out the FK mapping feature.
Help file, Index tab - fk mapping.
Movie:
http://modeling.inside.quest.com/entry.jspa?externalID=1668&categoryID=158

If you have any questions, please write me back. Thanks.

Regards,

Vladka


#3

Thank you. That explains it perfectly.