Home » SQL & PL/SQL » SQL & PL/SQL » ORA-02292: integrity constraint - violated - child record
ORA-02292: integrity constraint - violated - child record [message #298725] Thu, 07 February 2008 06:07 Go to next message
amardilo
Messages: 37
Registered: February 2007
Member
Hi there.

I am trying to delete a record out of a table but I keep getting the following message:

"ORA-02292: integrity constraint (TABLE_NAME_OF_TABLE_DELETING.xxxxxx) violated - child record found"

Does anyone know how I can find out what this constraint is using a SQL statement (i.e. in SQL*Plus)?

Re: ORA-02292: integrity constraint - violated - child record [message #298726 is a reply to message #298725] Thu, 07 February 2008 06:12 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member

search for primary key and foreign key constraints and also look for ON DELETE SET NULL / ON DELETE CASCADE clause.


regards,
Re: ORA-02292: integrity constraint - violated - child record [message #298734 is a reply to message #298726] Thu, 07 February 2008 06:34 Go to previous messageGo to next message
amardilo
Messages: 37
Registered: February 2007
Member
dhananjay wrote on Thu, 07 February 2008 06:12

search for primary key and foreign key constraints and also look for ON DELETE SET NULL / ON DELETE CASCADE clause.


regards,


Thanks dude. Do you know how I can do this kind of search?

Would it be something like:

SELECT TABLE_NAME_OF_TABLE_DELETING.sys_0000 FROM DUAL
Re: ORA-02292: integrity constraint - violated - child record [message #298736 is a reply to message #298734] Thu, 07 February 2008 06:38 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
DUAL? Why dual?
select * From user_constraints where constraint_name = 'YOUR_CONSTRAINT_NAME';

select * from user_cons_columns where constraint_name = 'YOUR_CONSTRAINT_NAME';
Re: ORA-02292: integrity constraint - violated - child record [message #298740 is a reply to message #298736] Thu, 07 February 2008 07:00 Go to previous messageGo to next message
amardilo
Messages: 37
Registered: February 2007
Member
Littlefoot wrote on Thu, 07 February 2008 06:38
DUAL? Why dual?


Total wild guess.

Thanks for you help. I'll try that out.

How do I know what the constraint name is?

[Updated on: Thu, 07 February 2008 07:21]

Report message to a moderator

Re: ORA-02292: integrity constraint - violated - child record [message #298743 is a reply to message #298740] Thu, 07 February 2008 07:49 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
amardilo wrote on Thu, 07 February 2008 08:00
Littlefoot wrote on Thu, 07 February 2008 06:38
DUAL? Why dual?

How do I know what the constraint name is?


It was right in the error message.
Re: ORA-02292: integrity constraint - violated - child record [message #298779 is a reply to message #298725] Thu, 07 February 2008 11:35 Go to previous messageGo to next message
amardilo
Messages: 37
Registered: February 2007
Member
Thanks for the help everyone.

Problem solved Smile
Re: ORA-02292: integrity constraint - violated - child record [message #298821 is a reply to message #298740] Thu, 07 February 2008 16:10 Go to previous message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
amardilo wrote on Thu, 07 February 2008 14:00
How do I know what the constraint name is?


Well, you chose to put all those 'x's, not me. Moreover, I was too lazy to count how many of them you've written, so I rather used a more meaningful 'your_constraint_name'. I just hope that you don't name constraint like 'xxxxxxxx'.
Previous Topic: How many users are connected to the database
Next Topic: Merge Update - ORA 30926
Goto Forum:
  


Current Time: Sat Dec 03 05:47:16 CST 2016

Total time taken to generate the page: 0.21634 seconds