Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORA-02303: cannot drop or replace a type with type or table dependents

Tags:

oracle

plsql

I'm newbee in oracle and I try to change varchar(50) to 250

CREATE OR REPLACE TYPE CEQ_OWNER.TYPE_REC_PARAE2
AS OBJECT    
(
    ...
    BONETAT_DESC  VARCHAR2(250),
    ... 
)
/    

I get ORA-02303: cannot drop or replace a type with type or table dependents

like image 568
FrankSharp Avatar asked Jul 26 '12 17:07

FrankSharp


3 Answers

There are other types or tables that depend on the type you want to change. If it's a dependent type, then you can use the FORCE option to change the type.

If it's a table that directly or indirectly uses the type, then you will need to create a new type and a new table, migrate all the data, and finally drop and rename tables and types.

See this Oracle documentation for some further information.

like image 118
Codo Avatar answered Nov 11 '22 11:11

Codo


I was looking everywhere for the syntax also, but was having a hard time finding the documentation. From the page that Codo linked... notice that the FORCE is between the object name and as object

create or replace type ceq_owner.type_rec_parae2 FORCE as object    
(
  ...
  BONETAT_DESC  VARCHAR2(250),
  ... 
)
/ 
like image 32
Gordolio Avatar answered Nov 11 '22 11:11

Gordolio


Try:

drop type your_type force;
like image 10
Lengoman Avatar answered Nov 11 '22 13:11

Lengoman