Big Dog: Foreign Key Error describes a sticky situation where Big Dog needs to drop a foreign key.
Is there a way to unspecify a foreign key constraint or is there a way to drop those tables that the mistake was made in? Any ideas are welcome.
There is a solution, but it is more complicated than you would like. I'll summarize it as follows:
- You need to list the constraints in your table space. The foreign key is a type of constraint. Oracle gives it a system name that you need to retrieve.
- You then need to drop the constraint by name.
Example codes for listing the constraints
select * from user_constraints;
Dropping the named constraint
ALTER TABLE <table_name> DROP CONSTRAINT <constraint_name>
where table_name is the name of the table and constraint_name is the name of the foreign key that you retrieved in Step 1.