Hi,

I am hoping that some oracle expert out there can look at this and provide a quick answer.

I am new to working with oracle objects and am trying to create an abstract object called attraction_objtyp with three object subtypes, coaster_objtyp,wetride_objtyp and childride_objtyp. The problem is that I am not sure how to code the method addAttraction() to add the child objects to a table that accepts all types of attraction.

the code is as follows:

<code>

--create attraction object
create type attraction_objtyp as object(
attractionid NUMBER(6),
attractionname VARCHAR2(100),
yearopened NUMBER(4),
cost NUMBER(20),
heightrestriction VARCHAR2(10),
ridecapacity NUMBER(3),
category VARCHAR2(25),

--method signatures
NOT INSTANTIABLE MEMBER FUNCTION validate_nonduplicate(x NUMBER) return BOOLEAN,
NOT INSTANTIABLE MEMBER PROCEDURE add_attraction(attractid NUMBER, attrname VARCHAR2,c NUMBER,hr VARCHAR2,rc NUMBER,cat VARCHAR2))NOT INSTANTIABLE NOT FINAL;
/

--create coaster object as subtype of attraction
create type coaster_objtyp under attraction_objtyp(
loopcount NUMBER(2),
maxspeed NUMBER(3),
duration VARCHAR2(20),
thrillfactor NUMBER(20),
overriding MEMBER FUNCTION validate_nonduplicate(x NUMBER) return BOOLEAN,
overriding member procedure add_attraction(attractid NUMBER, attrname VARCHAR2,c NUMBER,hr VARCHAR2,rc NUMBER,cat VARCHAR2,
l NUMBER,ms NUMBER,d VARCHAR2,tf NUMBER));
/


</code>

I havent' shown the other two children here but I am sure if you can help sort this I will be able to figure out the others.

Thanx in advance for the help.

Bye
Jaspin