--this will disable all foreign key constraints
begin
for i in (select constraint_name, table_name from user_constraints where constraint_type ='R'
and status = 'ENABLED') LOOP
execute immediate 'alter table '||i.table_name||' disable constraint '||i.constraint_name||'';
end loop;
end;
--this will enable them again
begin
for i in (select constraint_name, table_name from user_constraints where constraint_type ='R'
and status = 'DISABLED') LOOP
execute immediate 'alter table '||i.table_name||' enable constraint '||i.constraint_name||'';
end loop;
end;
Wednesday, May 21, 2008
Subscribe to:
Post Comments (Atom)
1 comments:
Thanks very much. This really helped
Post a Comment