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

上一篇 / 下一篇  2008-05-13 14:25:15 / 个人分类:总结

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.

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-08  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 3758
  • 日志数: 99
  • 建立时间: 2008-02-19
  • 更新时间: 2008-09-14

RSS订阅

Open Toolbar