Modify Supertype without dropping Subtypes [message #597248] |
Wed, 02 October 2013 01:03 |
wmgonzalbo
Messages: 98 Registered: November 2008
|
Member |
|
|
Hi All,
This might be wishful thinking but is there a way to modify supertypes without dropping / recreating its subtypes?
So far, I can't find any other way to do this.
Thanks in advance!
Regards,
WMG
|
|
|
Re: Modify Supertype without dropping Subtypes [message #597252 is a reply to message #597248] |
Wed, 02 October 2013 02:49 |
|
dariyoosh
Messages: 538 Registered: March 2009 Location: France
|
Senior Member |
|
|
Hello,
I don't understand what you mean by dropping subtypes? Types can be defined at schema level, but as far as I know, subtypes are specific to PL/SQL, therefore, at most, there can be defined at a package level.
Anyway, what is exactly the requirement and what are you trying to do? describe your scenario.
Regards,
Dariyoosh
[Updated on: Wed, 02 October 2013 03:03] Report message to a moderator
|
|
|
Re: Modify Supertype without dropping Subtypes [message #597256 is a reply to message #597252] |
Wed, 02 October 2013 03:42 |
wmgonzalbo
Messages: 98 Registered: November 2008
|
Member |
|
|
Supertype sample:
CREATE OBJ_SUPER1 as object
(num1 number,
num2 number,
str1 varchar2(100),
date1 date,
MEMBER FUNCTION getNum1 RETURN NUMBER,
MEMBER FUNCTION getStr1 RETURN VARCHAR2,
MEMBER FUNCTION getDate RETURN DATE
) NOT FINAL;
CREATE TYPE BODY OBJ_SUPER1 AS
-- list supertype methods' body
Subtype sample:
CREATE OBJ_MY_SUB1 UNDER OBJ_SUPER1
( subnum1 number,
subnum2 number,
subdate1 date,
MEMBER FUNCTION subnum1 RETURN NUMBER,
MEMBER FUNCTION subdate1 RETURN NUMBER
) NOT FINAL
/
CREATE TYPE BODY OBJ_MY_SUB1 AS
-- list subtype methods' body
Basically your subtype will inherit the attributes and methods of your supertype.
Currently whenever you have to update your supertype (parent), you have to drop its subtypes (children) under it.
A supertype can have several subtypes under it, so currently we are required to drop all children before we can modify the parent.
I'm wondering, if there's a way to modify your supertype without requiring you to drop its subtypes first?
If there is, then how..?
|
|
|
|
|
|
|