oracle ORA-02303: 不能删除或替换具有类型或表依赖项的类型

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11674807/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 04:21:59  来源:igfitidea点击:

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

oracleplsql

提问by FrankSharp

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

我是 oracle 的新手,我尝试将 varchar(50) 更改为 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

我得到 ORA-02303: 不能删除或替换类型或表依赖项

Thanks

谢谢

回答by Codo

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.

还有其他类型或表取决于您要更改的类型。如果是依赖类型,则可以使用 FORCE 选项更改类型。

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 documentationfor some further information.

有关更多信息,请参阅此Oracle 文档

回答by Gordolio

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 FORCEis between the object name and as object

我也在到处寻找语法,但很难找到文档。从 Codo 链接的页面...注意FORCE对象名称和as object

create or replace type ceq_owner.type_rec_parae2 FORCE as object    
(
  ...
  BONETAT_DESC  VARCHAR2(250),
  ... 
)
/ 

回答by Lengoman

Try:

尝试:

drop type your_type force;

回答by Arul Xavier S

There are some dependency for the Object you are trying to Modify or Drop.

您尝试修改或删除的对象存在一些依赖性。

If you want to skip this first drop the dependant Object and try to DROP or MODIFY

如果你想跳过这个首先删除依赖对象并尝试 DROP 或 MODIFY

Like in the below Screenshot

就像下面的截图

Regards, Arul

问候, 阿鲁