I have 2 user-defined Oracle object types:
- Parent Type A, and
- Child Type B
//------------------------------------------------------- >>
Parent Type A has attributes as follows: |Parent Type A | | ------| |* id Number | |* data String | |* name String |
//------------------------------------------------------- >>
I would like to change the "data" attributes so that it can be other types, besides String, in the case that I want to derive other Child types.
Per Oracle doc (on "Inheritance in SQL Object Types"):
"A subtype cannot drop or change the type of an attribute it inherited from its parent; it can only add new attributes."
My initial attempt is to see how setting the "data" attribute (of root Parent Type A) as the base type of SYS.ANYDATA (or SYS.ANYTYPE), may work. My hopes are that I can have derived type(s) assign a string, or even a RowType datatype, into "data", by setting it up initially as a generic type.
###[References]### Oracle Database Object-Relational Developer's Guide, 19c, via https://docs.oracle.com/en/database/oracle/oracle-database/19/adobj/object-relational-developers-guide.pdf