Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Alternate to ON DELETE CASCADE

SamFisherApr 20 2012 — edited Apr 20 2012
Hello All,

I have a situation where in I have to delete a record from the parent table. But I have to find the child records, delete those records and then delete the record in parent table.

For clear understanding I am using EMP, DEPT tables here.
I have Dept & Emp tables. Let us say we do not have 'on delete cascade' & I do not want to use constraints table to find the parent-child relationship, since it is taking long time.
I want to delete a record from DEPT table where deptno = 10.
But we can do that only after deleting all the records pertaining to deptno = 10 in EMP table.
I have the answer, I am using all_constarints table to find the primary key of EMP table and delete the records.

Any other options?

Thx
Shank.
This post has been answered by Frank Kulash on Apr 20 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2012
Added on Apr 20 2012
3 comments
885 views