Tutorial :Is there a way to specify a super-type sub-type relationship in Oracle Designer?


I was wondering if it is possible to create a super-type sub-type relationship in Oracle Designer. I would like to create something like this:

alt text http://ww2.cis.temple.edu/cis109friedman/CIS%20109%20-%20Lecture%20Set%20III%20-%20ERD%20and%20EERDs%20and%20Modeling/Emp-super.gif



In entity relationship diagrams subtypes are created by creating a new entity inside an existing entity like this example from InformIT.com:

ERD Diagram http://www.informit.com/content/images/chap3_0130282286/elementLinks/03fig28.gif

This shows that ORDER has subtypes PURCHASE ORDER and SALES ORDER, i.e. every ORDER is either a PURCHASE ORDER or a SALES ORDER.

Subtypes can be nested to any depth.

Although this example doesn't show any, subtypes can also have their own attributes and relationships.


Note that if you're working in the Design Editor on the physical model, you have to implement as actual tables.

But take a look at the documentation for the Foreign Key property "Arc", which might help some. You can set it so that exactly 1 of several foreign keys can have a value.

For example, you might set up FK's from your supertype table to each subtype table. Then enforce that exactly one can have a value by using that property and generating the TAPI for the tables. (The drawback is that you'd have to insert the subtype information before the supertype.)

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »