How do I find child tables and manipulate their content? [message #21797] |
Fri, 30 August 2002 13:00 |
Fredrik Ohrn
Messages: 2 Registered: August 2002
|
Junior Member |
|
|
Hello!
I have a bunch of parent tables and an even bigger bunch of child tables all tangled in a complicated referential relationship mess.
I have two things I want to do:
1. "Reparent" child records.
Find all child tables and update their records to point to a new parent record B instead of the old parent record A.
Input is an arbitary table and the two parent records.
2. Cascade delete child records.
Find all child tables and delete all records referring to parent record A.
Input is an arbitary table and the parent record A.
(I don't think on cascade delete will work, since I don't want to delete the parent record itself. Or?)
I assume a PL/SQL script will be necessary to accomplish this. I would gladly RTFM but I s**k so bad at PL/SQL so I don't even know where to start.
Suggestions, examples and pointers to more reading would be greatly appreciated.
Regards,
Fredrik
|
|
|
|