PL/SQL alter table. , , cascade, ( ).
:
create table t1(c1 number primary key);
create table t2(c1 number references t1(c1));
create table t3(c1 number references t1(c1));
select table_name
, constraint_type
, status
from user_constraints
where table_name in ('T1','T2', 'T3')
TABLE C STATUS
T2 R ENABLED
T1 P ENABLED
T3 R ENABLED
3 rows selected.
:
alter table t1 disable primary key cascade;
alter table t1 enable primary key;
:
select table_name
, constraint_type
, status
from user_constraints
where table_name in ('T1','T2', 'T3')
TABLE C STATUS
T2 R DISABLED
T1 P ENABLED
T3 R DISABLED
3 rows selected.
Note . It is not possible to re-enable all foreign key constraints in cascading mode. This must be done manually.
source
share