truncate有外鍵約束的表,報ORA-02266處理。

問題描述:當父表有子表的外鍵約束時,沒法直接truncate父表。報ORA-02266: unique/primary keys in table referenced by enabled foreign keys。 這裏使用另外一種辦法來解決這個問題:先把外鍵失效,truncate表以後再把外鍵生效。 SQL> truncate table machine_room; truncate tab
相關文章
相關標籤/搜索