oracle 提示:ORA-02292:integrity constraint(xxxxxxx) violated - child record found
生活随笔
收集整理的這篇文章主要介紹了
oracle 提示:ORA-02292:integrity constraint(xxxxxxx) violated - child record found
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
當我們刪除 數據的時候 oracle 提示:ORA-02292:integrity constraint(xxxxxxx) violated - child record found
這種情況呢是因為外鍵關聯的存在,需刪除另一個表的信息后才能將該信息刪除。
這種情況首先應該去尋找是否有表與當前表存在關聯,若能找到最好按順序進行刪除。若無法找到,可以采用以下的方法強制刪除,但以下方法會影響數據在表中的結構,也許會形成垃圾數據(謹慎使用)。
-
第一步:讓主鍵失效:alter table table_name disable primary key cascade;
-
第二步:刪除數據:delete from table_name where id = ‘xx’;
-
第三步:讓主鍵生效:alter table table_name enable primary key;
總結
以上是生活随笔為你收集整理的oracle 提示:ORA-02292:integrity constraint(xxxxxxx) violated - child record found的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 快起床刷题去,别人把你offer拿走啦
- 下一篇: 分割数组(将数组三等分)