I have two queries for disabling all constraints, but they don't seem to be working.
first one disables foreign keys:
select 'alter table '||table_name||' disable constraint '||constraint_name||';'
from user_constraints
where constraint_type ='R'
and status = 'ENABLED';
and the second disables everything else:
select 'alter table '||table_name||' disable constraint '||constraint_name||';'
from user_constraints
where status = 'ENABLED';
Now when I check the constraints with SELECT * FROM USER_CONSTRAINTS
I can see that they all are still 'ENABLED'.
Why is this?
I tried commit after running the queries but to no avail.
My goal is to disable constraints from all tables with those queries.
alter tablestatements that these have generated!and status = 'ENABLED'line (just to see what it finds).