Home » SQL & PL/SQL » SQL & PL/SQL » Query to find parent - child records (Oracle 10g ,solaris)
Query to find parent - child records [message #411524] Sat, 04 July 2009 12:25 Go to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member


Hi,

I am looking for a script or query which
should display both parent table in relation with
child table because sometime i receive error like
(ORA-02292 Constraint violation - child records found)
when trying to delete some records from parent table.


Thanks in advance

Regards
Re: Query to find parent - child records [message #411525 is a reply to message #411524] Sat, 04 July 2009 12:32 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.

SQL> desc all_constraints
 Name					   Null?    Type
 ----------------------------------------- -------- ----------------------------
 OWNER					   NOT NULL VARCHAR2(30)
 CONSTRAINT_NAME			   NOT NULL VARCHAR2(30)
 CONSTRAINT_TYPE				    VARCHAR2(1)
 TABLE_NAME				   NOT NULL VARCHAR2(30)
 SEARCH_CONDITION				    LONG
 R_OWNER					    VARCHAR2(30)
 R_CONSTRAINT_NAME				    VARCHAR2(30)
 DELETE_RULE					    VARCHAR2(9)
 STATUS 					    VARCHAR2(8)
 DEFERRABLE					    VARCHAR2(14)
 DEFERRED					    VARCHAR2(9)
 VALIDATED					    VARCHAR2(13)
 GENERATED					    VARCHAR2(14)
 BAD						    VARCHAR2(3)
 RELY						    VARCHAR2(4)
 LAST_CHANGE					    DATE
 INDEX_OWNER					    VARCHAR2(30)
 INDEX_NAME					    VARCHAR2(30)
 INVALID					    VARCHAR2(7)
 VIEW_RELATED					    VARCHAR2(14)


http://www.google.com/search?btnG=1&pws=0&q=oracle+Query+to+find+parent+child+records

[Updated on: Sat, 04 July 2009 12:35]

Report message to a moderator

Re: Query to find parent - child records [message #411651 is a reply to message #411524] Mon, 06 July 2009 04:03 Go to previous message
ayush_anand
Messages: 417
Registered: November 2008
Senior Member
you can also use "ON DELETE CASCADE "
Previous Topic: How to check Plan table
Next Topic: Data Not insert into table from PROCEDURE
Goto Forum:
  


Current Time: Sat Dec 10 16:20:37 CST 2016

Total time taken to generate the page: 0.11619 seconds