如何在表中的唯一/主键被外部关键字引用的情况下drop表

SQL> create table t (t1 int primary key);

Table created.

SQL> create table t1 (t1 int,t2 varchar2(20));

Table created.

SQL> alter table t1 add constraint frg_t1 foreign key (t1) references t;

Table altered.

SQL> drop table t;
drop table t
          *
ERROR at line 1:
ORA-02449: unique/primary keys in table referenced by foreign keys


SQL> drop table t cascade constraints;

Table dropped.

你可能感兴趣的:(如何在表中的唯一/主键被外部关键字引用的情况下drop表)