Home » SQL & PL/SQL » SQL & PL/SQL » About 'ORA-02292' Error
icon6.gif  About 'ORA-02292' Error [message #251486] Fri, 13 July 2007 16:11 Go to next message
jack_h
Messages: 4
Registered: May 2007
Location: Vancouver
Junior Member
please help me answer question:

I do one transaction:
delete the child record first,
then delete parent record,
comitt.

Sometime the 'ORA-02292 Error was happen.
Re: About 'ORA-02292' Error [message #251488 is a reply to message #251486] Fri, 13 July 2007 16:16 Go to previous messageGo to next message
Littlefoot
Messages: 21824
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Maybe you didn't delete ALL child records?
Re: About 'ORA-02292' Error [message #251492 is a reply to message #251486] Fri, 13 July 2007 16:50 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
jack_h wrote on Fri, 13 July 2007 15:11
please help me answer question:

I do one transaction:
delete the child record first,
then delete parent record,
comitt.

Sometime the 'ORA-02292 Error was happen.




Quote:
ORA-02292: integrity constraint (string.string) violated - child record found
Cause: attempted to delete a parent key value that had a foreign key dependency.
Action: delete dependencies first then parent or disable constraint.
icon7.gif  Re: About 'ORA-02292' Error [message #251510 is a reply to message #251492] Fri, 13 July 2007 20:38 Go to previous messageGo to next message
jack_h
Messages: 4
Registered: May 2007
Location: Vancouver
Junior Member
Thanks for reply.

At customer side, parent table contain 150,000 large records, the child table contain a few record. Some time, the 'ORA-02292' Error occurs when commit the transaction.

I did some test using a few record table, it no error. The child record should be deleted before deleting parent record. I have no idea with this.
Re: About 'ORA-02292' Error [message #251521 is a reply to message #251510] Sat, 14 July 2007 00:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68758
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Create your foreign with the option "ON DELETE CASCADE" then you just have to delete the parent, Oracle will automatically delete all the children.

Also: maybe there are children on some the children you deleted (with a deferred constraint as you get this error on commit).

Regards
Michel
icon7.gif  Re: About 'ORA-02292' Error [message #251845 is a reply to message #251486] Mon, 16 July 2007 19:48 Go to previous message
jack_h
Messages: 4
Registered: May 2007
Location: Vancouver
Junior Member
Thanks for your help.
I found the reason is:
when I open the sqlplus and execute the transation, the error is happened.
Previous Topic: No data found. Is it a bug?
Next Topic: Character Set in Oracle
Goto Forum:
  


Current Time: Tue Jun 17 02:05:14 CDT 2025