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