Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Disabling check constraints
Valentin Minzatu ha scritto:
> 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
I tried it but it seems to have no effect on the problem:
1 BEGIN
2 FOR c IN (SELECT table_name, constraint_name FROM
user_constraints
3 WHERE constraint_type = 'C' )
4 LOOP 5 EXECUTE IMMEDIATE 'ALTER TABLE '||c.table_name||' DISABLE 6 CONSTRAINT '||c.constraint_name; 7 END LOOP;
SQL> update entity_fields set id_entity=id_entity + 10000;
update entity_fields set id_entity=id_entity + 10000
*
ERRORE alla riga 1:
ORA-02291: restrizione di integrità violata (DDS.ENTITYFIELDS) -
chiave madre
non trovata
SQL> update entity set id_entity=id_entity + 10000;
update entity set id_entity=id_entity + 10000
*
ERRORE alla riga 1:
ORA-02292: restrizione di integrità violata (DDS.ENTITYFIELDS) -
chiave figlia
trovata
What is wrong? Received on Mon Oct 16 2006 - 09:41:55 CDT