##  DBA Command Post - RI_disable.sql  &  RI_enable.sql


select 'alter table '|| T.owner||'.'||T.table_name||
       ' disable constraint '||T.constraint_name||';'
from   USER_CONSTRAINTS T,
       USER_CONSTRAINTS F
where  
       F.table_name     like upper('&Table_Name')
and    F.constraint_type  in ('P', 'U')
and
       T.R_CONSTRAINT_NAME = F.CONSTRAINT_NAME
/


select 'alter table '|| T.owner||'.'||T.table_name||
       ' enable constraint '||T.constraint_name||';'
from   USER_CONSTRAINTS T,
       USER_CONSTRAINTS F
where  
       F.table_name     like upper('&Table_Name')
and    F.constraint_type  in ('P', 'U')
and
       T.R_CONSTRAINT_NAME = F.CONSTRAINT_NAME
/
	