Home » SQL & PL/SQL » SQL & PL/SQL » Recompiling base object type and ORA-02303 (Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production)
Recompiling base object type and ORA-02303 [message #291193] Thu, 03 January 2008 06:09 Go to next message
Buchas
Messages: 101
Registered: March 2006
Senior Member
Hello,

I have created a hierarchy of objects in Oracle. The base object is this:
CREATE OR REPLACE TYPE CommonObj IS OBJECT
(
            nID          NUMBER,
  FINAL MAP MEMBER FUNCTION GetID RETURN NUMBER ,
  FINAL MEMBER PROCEDURE SetID ( nIDParm IN NUMBER ),
  FINAL MEMBER FUNCTION IsInitialised RETURN BOOLEAN
  ) NOT FINAL NOT INSTANTIABLE ;

CREATE OR REPLACE TYPE BODY CommonObj AS
   
  -----------Set & get-----------
FINAL MAP MEMBER FUNCTION GetID RETURN NUMBER IS
  BEGIN
    RETURN nID;
  END;
  -----
 FINAL MEMBER PROCEDURE SetID ( nIDParm IN NUMBER ) IS
  BEGIN
    nID := nIDParm;
  END;
  
  -----------testing-----------
 FINAL MEMBER FUNCTION IsInitialised RETURN BOOLEAN IS
  BEGIN
    RETURN GetID() IS NOT NULL;
  END;
END;


The CommonObj serves as a basic object type for other types, who need to use methods GetID(), and IsInitialised(). [There is plenty of them - a whole hierarchy]. For example they are created as follows:

CREATE OR REPLACE TYPE PolisasObj 
UNDER COMMONOBJ  
(
            nPARD_VIEN_VER_ID    NUMBER,
  <....>
  MEMBER PROCEDURE Init ( nIDParm IN NUMBER )
  )
;


The problem is that if I want to modify (add one more method or instance variable) the CommonObj, I get the error while recompiling:
ORA-02303: cannot drop or replace a type with type or table dependents.
I find it very annoying, as I have to go through all the type hierarchy and make all subtypes not to use CommonObj.
Help please, is there any easier way of doing that?
Like in Java, I can modify any superclass I want...

[Updated on: Thu, 03 January 2008 06:11]

Report message to a moderator

Re: Recompiling base object type and ORA-02303 [message #291196 is a reply to message #291193] Thu, 03 January 2008 06:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
DROP TYPE FORCE

Regards
Michel
Re: Recompiling base object type and ORA-02303 [message #291201 is a reply to message #291196] Thu, 03 January 2008 06:33 Go to previous message
Buchas
Messages: 101
Registered: March 2006
Senior Member
Thanks!
Previous Topic: Oracle external tables
Next Topic: How to load LOB in the database (merged)
Goto Forum:
  


Current Time: Fri Feb 07 14:55:47 CST 2025