Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Mutual-exclusive inheritance types

988627Feb 1 2013 — edited Feb 1 2013
Hi!
I have the following types:

create or replace type Film_ty as object(
...
);

create or replace type Entertainment_ty as object(
...
)not final;

create or replace type Spot_ty under Entertainment_ty (
....
);

create or replace type Trailer_ty under Entertainment_ty (
of_film REF Film_ty,
....
);
I created the object table for Film_ty and Entertainment_ty using "create table entertainment of Entertainment_ty" and "create table film of Film_ty" . I didn't create any collection or object table for Trailer_ty, because I read on the "Object Oriented Oracle" book that I don't have to do it if I want a mutual-exclusive inheritance relation. Now, I want to delete the trailer of a given film. How can I do such a thing if I can't access to the reference in the entertainment table, with something like "entertainment.of_film "?
I also tried a simple query of selection: "select value(e) from entertainment e;" The result is "[owner.Trailer_ty]". I can't find a way to access to the data stored in the object table entertainment referred to the Trailer_ty type.
Can you help me to solve it, please??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2013
Added on Feb 1 2013
4 comments
193 views