新博客http://www.cnblogs.com/zhjh256 欢迎访问
分类: Oracle
2008-01-06 21:16:50
最近版本的Oracle允许更改一个类型而无需重建,如下:
create type T1 as object ( x number, y number ) not final;
/
Type created.
create type T2 as table of T1;
/
Type created.
create or replace type T1 as object ( x number, y number, z number );
/
create or replace type T1 as object ( x number, y number, z number );
*
ERROR at line 1:
ORA-02303: cannot drop or replace a type with type or table dependents
需要做的仅仅是ALTER TYPE:
alter type T1 add attribute ( z number );
alter type T1 add attribute ( z number )
*
ERROR at line 1:
ORA-22312: must specify either CASCADE or INVALIDATE option
alter type T1 add attribute ( z number ) cascade;
Type altered.