Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Script request for FK enable/disable
I inherited a job that tries to truncate about 20 tables weekly. After
executing the truncate command, the script then does a delete cascade of the
table. This was done because some of the truncate commands fail due to:
ORA-02266: unique/primary keys in the table referenced by enabled foreign keys
Does anyone out there have a script already developed that will allow me to enter a table name and have it generate the appropriate disable and enable commands, so I can truncate the table?
I've been trying to figure it out, using the dba_constraints table, but I haven't gotten very far yet, and I'd like to avoid re-inventing the wheel if possible.
Thanks again to the list for your help with the issue I raised yesterday about redo logs on import. We are going to turn logging off on the tables before the load and turn it back on after the load. Hopefully that will put out one of the fires with this process.
Steve