How to get all child records from a table with multiple self referential integrity constraints? (merged 3) [message #676251] |
Thu, 23 May 2019 02:01 |
|
rrcr
Messages: 18 Registered: January 2019
|
Junior Member |
|
|
As per the requirement i have to identified data from table t1. Once the data is identified i need to identify its child records as well.
I could easily identify its childs if there is only one self referential constraint.
like
select * from t1
start with c1=100
connect by prior c1=c2;
But My table has multiple self referential integrity constraints like below
create table t1(
c1 number pk,
c2 number references c1,
c3 number references c1,
c4 number references c1);
i have tried to identify the childs of each self RI separately. But the problem here is after identifying the childs i have to delete all the childs and parent records.
With the approach of identifying the self referential Integrity separately we may find one record is child in one self RI the same record might be parent in other Self RI. so while deleting we are facing child record found issue.
so i have used the below query to identify all the childs in one shot. But the query is running for hours and not getting finished.
select * from t1
start with c1=100
connect by prior c1=c2 or prior c1=c3 or prior c1=c4;
Please suggest a way to identify all the childs and delete them without constraint issues.
Thanks
|
|
|
|
|
|
|
|
|
|
Re: How to get all child records from a table with multiple self referential integrity constraints? (merged 3) [message #676277 is a reply to message #676266] |
Fri, 24 May 2019 08:06 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
rrcr wrote on Thu, 23 May 2019 23:30I myself posted on other forum too to get solution.. But No one give answer. people are more concerned with formatting it seems than actual query
Yes, I know it was you. The people there are trying to get you to help them to to help you. Just like here, or any forum, you need to supply the requested information in a readable format. IT doesn't matter if you think you've provided the necessary information in a useful format. You are asking others to help you, so you need to give them what they ask for.
Also, the reason I posted a notice on both places of the posting in the other was to alert others of the cross posting. A lot of people are on both forums and don't want to get sucked into trying to deal with the same issue in two places.
|
|
|