I have a problem where I need to drop certain tables and Create replacements (schema additions/deletions to the tables).
Because I have Grandfather-Father-Son table type relationships I have Foreign Keys between them. I need to drop the Foreign Keys but if I build a script to SELECT "ALTER TABLE {TableName} DROP CONTRAINT {ConstraintName}" FROM USER_CONSTRAINTS the order matters where it chooses the Father table for example first.
If I change the script being built to have "...{ConstraintName} CASCADE" whilst it runs succesfully it ends up with hundreds of ORA-02443 Errors because the constraint has already been removed by an earlier "ALTER TABLE" command.
Is there a way that I can tell which tables are the Grandfathers and just include those CASCADE'd in my selection? That way presumably, all the Foriegn Keys will be deleted without any overlying superflous errors.
Many thanks,
Software/Hardware used:
ASKED:
August 18, 2005 3:36 AM
UPDATED:
August 19, 2005 12:30 PM