Relationship Inheritance from Supertype to Subtype (RELATE)

Previous Next

If you have defined a relationship between a supertype and another table, you can join any subtypes to that other table using the same relationship.

Suppose parent table "Super1" has a relationship with role "HAS" and co-role "OF" to child table "Other1". If "Super1" has a subtype table "Sub1", then you can use the same relationship to join "Sub1" to "Other1", because "Sub1" inherits the relationship from its supertype "Super1":

SELECT    ...
FROM      Sub1, Other1
RELATE    Sub1 "HAS" Other1
WHERE     ...

 

or, if for some reason you use conventional join syntax rather than RELATE:

SELECT    ...
FROM      Sub1, Other1
WHERE     Sub1.primary-key = Other1.foreign-key
AND       ...
 

 

See Also

Supertypes and Subtypes