小弟先前建立了对象类型object_type1,然后建立了一个对象表 create table table1 of object_type1,然后在表中存入了很多对象数据,现在我想修改对象类型中的某个属性字段类型, 用create or replace 修改时 提示ORA-02303: 无法使用类型或表的相关性来删除或取代一个类型
 
然后我的想法是drop type object_type1 ,也无法删除,最后我只好先drop table table1 后再drop type object_type1, 最后再重新 create or repacle 对象类型,但是我表中的数据都没了,
请龙虾们帮我解释下这当中的机制是怎么样,如何才能比较容易的改变对象类型中的属性类型,(当然我修改的类型是适合存储表中的数据的)

解决方案 »

  1.   

    ORA-02303: cannot drop or replace a type with type or table dependents 
    Cause: An attempt was made to drop or replace a type that has dependents. There could be a substitutable column of a supertype of the type being dropped.
    Action: Drop all type(s) and table(s) depending on the type, then retry the operation using the VALIDATE option, or use the FORCE option.看文档
    所以 你已经建立好多对象,那么当然不允许改对象类型了;
    删了对象才能改对象类型的定义呀
      

  2.   

    Oracle里没有一项技术是“为了***体系的完整性,我们发明了***”的所有Oracle的技术点都是为了某种需求而出现的,所以,如果你对一个技术没有需求,不用去钻研它。