全部博文(136)
分类: Oracle
2009-05-27 15:10:12
SQL> create table yct1(id number not null, name varchar2(20));
Table created
SQL> alter table yct1 add constraint pk_yct1 primary key (id);
Table altered
SQL> create table yct2 (id number);
Table created
SQL> alter table yct2 add constraint fk_yct2 foreign key (id) references yct1(id);
Table altered
SQL> truncate table yct1;
truncate table yct1
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
SQL> delete yct1;
0 rows deleted |