Toad World® Forums

Why I don't have 'foreign key' tab in realtionship propoerties?


I’m trying to create foreign keys in a ER diagram. Supposedly, when I double click the relationship line and open its relationship properties, I should see a ‘foreign keys’ tab. However, I only have 4 tabs: General, Cardinality, Description, To Do. Why?

How can I set up foreign keys in this situation? Thanks!



the Foreign key tab is available only in physical model, not logical model. Logical model should be created if you wish to work with inheritance, model super types and subtypes etc. In logical model, you can create Primary Unique Identifier and Unique identifiers. If you wish to change the linking method, edit the relationship in logical model, click tab General and select appropriate identifier from the Foreign Unique Identifier combo box.

Note: in logical model no attributes migrate to child entities. In physical model, whenever you draw a relationship from parent entity to child entity, all PK (primary key) attributes will appear in child entity as PFK (primary foreign key) or FK (foreign key) attributes.

Try to create two entities with several attributes and one Primary Unique Identifier and one single relationship in logical model and then create the same (two entities, several attributes, PK, one relation) in physical model and see the differences.

If you don’t plan to use inheritance, it will be probably better to use physical model instead of logical.