Authored by: Peter Boekelaar Viewed:
1869 times so far
Why this script?
Most of the FK's defined in an Oracle DB, are not created using the on delete cascade option, since that is (most of the times) not wanted at all.
But sometimes records must be deleted while it is not allowed to do so, because there are child records (or a complete tree of child records) present.
For cases like that I use a script that searches the DB for child recs, using the SYS views.
Restrictions
The script only works on schema's where technical keys are used, i.e. primary keys that only contain one (numeric) column and the schema must be fully referential defined.
Usage
Fill in the local parameters SCHEMA_OWNER, MASTER_TABLE and MASTER_TABLE_ID. Execute the script. All underlying records will deleted using a recursive procedure. You can easely adjust the script by adding a cursor to delete multiple masterrecords.
enjoy!
Click Here to View all the questions in Scripts category.
christian.kindler@gmx.neton Wed, Jun 25th, 2008 at 6:22 AM Too bad:
The requested URL /admin/attachments/del_rec_cascade.sql was not found on this server.
I could really use such a script.
vikas1975@hotmail.comon Thu, Jun 26th, 2008 at 6:45 AM hi,
this script cannot be downloaded. Is there any problem?
Vikas