Hello,
I have some object types created on Oracle 9i, defining a type hierarchy under a base supertype (see below). I also have a table that have a column of the base object type. When I insert values of the base object type and values of the child object types on the same table it works fine. But I'm having trouble to access the values of the child's attributes when I use a TOracleQuery to select the rows from this table and the ObjField to access the column that contains the objects. What do I have to do to access the child's attributes (i.e. Student_typ's deptid and major) using a TOracleQuery's ObjField method?
/********** Object type created on Oracle 9i *********/
CREATE TYPE Person_typ AS OBJECT
( ssn NUMBER,
name VARCHAR2(30),
address VARCHAR2(100)) NOT FINAL;
CREATE TYPE Student_typ UNDER Person_typ
( deptid NUMBER,
major VARCHAR2(30)) NOT FINAL;
CREATE TYPE PartTimeStudent_typ UNDER Student_typ
( numhours NUMBER);
/********** Table with a Person_typ column **********/
CREATE TABLE persons
( seq NUMBER
person Person_typ);
/************* Rows inserted on the table ************/
INSERT INTO persons VALUES (1,Person_typ(1243,
I have some object types created on Oracle 9i, defining a type hierarchy under a base supertype (see below). I also have a table that have a column of the base object type. When I insert values of the base object type and values of the child object types on the same table it works fine. But I'm having trouble to access the values of the child's attributes when I use a TOracleQuery to select the rows from this table and the ObjField to access the column that contains the objects. What do I have to do to access the child's attributes (i.e. Student_typ's deptid and major) using a TOracleQuery's ObjField method?
/********** Object type created on Oracle 9i *********/
CREATE TYPE Person_typ AS OBJECT
( ssn NUMBER,
name VARCHAR2(30),
address VARCHAR2(100)) NOT FINAL;
CREATE TYPE Student_typ UNDER Person_typ
( deptid NUMBER,
major VARCHAR2(30)) NOT FINAL;
CREATE TYPE PartTimeStudent_typ UNDER Student_typ
( numhours NUMBER);
/********** Table with a Person_typ column **********/
CREATE TABLE persons
( seq NUMBER
person Person_typ);
/************* Rows inserted on the table ************/
INSERT INTO persons VALUES (1,Person_typ(1243,