您的位置:首页 > 运维架构

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

2011-04-11 17:34 281 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: