Home » SQL & PL/SQL » SQL & PL/SQL » "Table inheritance" in Oracle (Oracle 11g)
"Table inheritance" in Oracle [message #448927] Thu, 25 March 2010 17:40 Go to next message
rivvorz
Messages: 2
Registered: March 2010
Location: UK
Junior Member
Hello there,

Please excuse the crude example below, but I am finding the Object Relational implementation rather confusing!

If Employee and Customer are sub-types of Person, when creating the object tables, how can you name the necessary Nested Tables to represent the relationships of the Child objects?

           [PERSON]
              |
    __________|__________
   |                     |
   |                     |
[EMPLOYEE]           [CUSTOMER]
   |1                    |1
   |                     |
   | organises           | attends
   |(organisedBy)        | (isAttendedBy)
   |                     |
   |*                    |*
    ------[EVENTS]-------



CREATE TABLE Person_TBL of Person (Person# PRIMARY KEY)
NESTED TABLE organises STORE AS EventListType;



Am I right in thinking that the Person table will hold both Employee and Customer objects (object types have been declared such)?

But then how would the Nested tables of Employee.organises and Customer.attends be named?

Advice much appreciated!
Re: "Table inheritance" in Oracle [message #448928 is a reply to message #448927] Thu, 25 March 2010 17:51 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Object Oriented Programming and RDBMS are orthogonal concepts

Trying to combine them is done at your own peril.
Re: "Table inheritance" in Oracle [message #449121 is a reply to message #448928] Fri, 26 March 2010 16:04 Go to previous messageGo to next message
rivvorz
Messages: 2
Registered: March 2010
Location: UK
Junior Member
As far as I'm aware, it is possible, I'm just not sure how!
Re: "Table inheritance" in Oracle [message #449123 is a reply to message #449121] Fri, 26 March 2010 18:15 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>As far as I'm aware, it is possible,

What do you gain if you succeed in doing what you desire?

What price will you pay after implementing OOP on top of RDBMS (see below)?

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1545206281987

Years ago Oracle offered a product called Object Oriented Oracle which took off like a lead balloon.

[Updated on: Fri, 26 March 2010 22:08]

Report message to a moderator

Re: "Table inheritance" in Oracle [message #449176 is a reply to message #448927] Sat, 27 March 2010 11:27 Go to previous message
Kevin Meade
Messages: 2103
Registered: December 1999
Location: Connecticut USA
Senior Member
The syntax of the nested tables clause allows you to name tables any way you want. Do a google for "oracle nested tables" and you will see.

Kevin
Previous Topic: retrieving records
Next Topic: Permission
Goto Forum:
  


Current Time: Fri Feb 07 18:37:06 CST 2025