BEGIN
for c in (select 'alter table '||table_name||' disable constraint '||constraint_name||' ' as v_sql from user_constraints where CONSTRAINT_TYPE='R')
loop
begin
execute immediate c.v_sql;
……
[/Quote]谢谢~~此处只能将这些外键P量置为不可用~~
BEGIN
for c in (select 'alter table '||table_name||' disable constraint '||constraint_name||' ' as v_sql from user_constraints where CONSTRAINT_TYPE='R')
loop
begin
execute immediate c.v_sql;
exception when others then
dbms_output.put_line(sqlerrm);
end;
end loop;
end;