我在删除表中的数据,用truncate,但是发现出现ORA-02266: unique/primary keys in table referenced by enabled foreign keys;
说明我有外键,那么我问两个问题:
1。如何先消除foreign keys,又如何在truncate之后恢复foreign keys
2。如果现在我不要这个表了,我要drop掉,但是同样是ORA-02449: unique/primary keys in table referenced by foreign keys;
那么如何不管这个ORA-02449,直接删掉这个表呢?
回复:
如果从其它表有到这个表的外键引用,那么就不能使用 TRUNCATE
drop table table_name cascade constraints;