Hello All,
I am using Oracle SQL Developer
I am trying to disable all tables constraints so I can truncate the tables.
this is what I came up with but it is not working. Can someone please help me.
Thanks in advance,
Kevin
begin
for cur in (select fk.owner, fk.constraint_name , fk.table_name
from all_constraints fk, all_constraints pk
where fk.CONSTRAINT_TYPE = 'R' and
pk.owner = 'EIFILTERED' and
fk.r_owner = pk.owner and
fk.R_CONSTRAINT_NAME = pk.CONSTRAINT_NAME and
pk.TABLE_NAME = 'ADDRESS', 'ALTERNATENAME', 'ACTIVITY', 'CASEEVENT'
) loop
execute immediate 'ALTER TABLE "'||cur.owner||'"."'||cur.table_name||'" MODIFY CONSTRAINT "'||cur.constraint_name||'" DISABLE';
end loop;
end;