troubleshooting Question

delete records from table with foreign  keys

Avatar of cofactor
cofactorFlag for India asked on
Oracle Database
7 Comments4 Solutions1248 ViewsLast Modified:
I have 3 tables .  the tables are connected with Foreign keys

I want to delete some records but as they are interconnected by foreign keys i have to delete all of the dependencies.

I want a query like below but this does not work

delete from tableA , tableB , tableC where tableA.w = tableB.m and tableB.r =tableC.s  AND tableA.y=5


i think this way i can remove the records from the above 3 tables which are connected by foreign keys

but that query is not correct .......can you  make my query correct ?
ASKER CERTIFIED SOLUTION
crxi

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 4 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros