Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Disabling check constraints

Re: Disabling check constraints

From: Valentin Minzatu <valentinminzatu_at_yahoo.com>
Date: 16 Oct 2006 06:30:53 -0700
Message-ID: <1161005453.008534.47800@m73g2000cwd.googlegroups.com>


You can also do it dinamically, using "execute immediate": BEGIN
     FOR c IN (SELECT table_name, constraint_name FROM user_constraints WHERE constraint_type = 'C' )

     LOOP
         EXECUTE IMMEDIATE 'ALTER TABLE '||c.table_name||' DISABLE
CONSTRAINT '||c.constraint_name;
     END LOOP;

END;
/

More details about execute immediate can be found in "PL/SQL Guide and Reference".

Cheers,
Valentin Received on Mon Oct 16 2006 - 08:30:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US