11.2对于CREATE OR REPLACE TYPE语句进行了增加,增加了FORCE选项。
在11.2之前,只要有其他的表或TYPE依赖了当前对象,这个对象就无法进行REPLACE了:
SQL> create type t_num_tab is table of number;
2 /
Type created.
SQL> create type t_record is object (id number, n_tab
t_num_tab);
2 /
Type created.
SQL> create or replace type t_num_tab is table of
number(5);
2 /
create or replace type t_num_tab is table of number(5);
*
ERROR at line 1:
ORA-02303: cannot drop or replace a type with type or table dependents
这是11.2之前的情况,尝试执行CREATE OR REPLACE将会导致ORA-2303错误,在11.2中Oracle增加了FORCE功能,使得一个仅被TYPE所依赖的对象仍然可以执行REPLACE的操作:
SQL> create or replace type
t_num_tab force is table of number(5);
2 /
Type created.
SQL> select * from v$version;
BANNER
-----