-- #############################################################################################
--
-- %Purpose: Disable all relational constraints on tables owned by the user that executes this script
--
-- #############################################################################################
--
-- Requires Oracle 8.1
--
------------------------------------------------------------------------------
PROMPT
PROMPT Generating script to disable the relational constraints...

set pagesize 0
set feedback off
set termout off
set linesize 100
set trimspool on
set wrap on

spool disable_relational_constraints.lst.sql

PROMPT PROMPT
PROMPT PROMPT Disabling relational constraints...

SELECT 'PROMPT ... disabling constraint '||constraint_name||' on table '||table_name
,      'alter table '||table_name||' disable constraint '||constraint_name||';'
FROM   user_constraints
WHERE  constraint_type = 'R'
/

spool off
set feedback on
set termout on
spool disable_relational_constraints.log
@disable_relational_constraints.lst.sql
spool off
