1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| SQL>
SQL> create table parent(x int primary key);
Table created.
SQL> create table enfant(x int primary key, y int);
Table created.
SQL> alter table enfant add constraint fk foreign key (y) references parent(x);
Table altered.
SQL>
SQL> insert into parent values(1);
1 row created.
SQL> insert into parent values(2);
1 row created.
SQL>
SQL> insert into enfant values(1,1);
1 row created.
SQL> insert into enfant values(2,2);
1 row created.
SQL>
SQL> commit;
Commit complete.
SQL>
SQL> alter table enfant disable constraint fk;
Table altered.
SQL>
SQL> truncate table enfant;
Table truncated.
SQL> truncate table parent;
Table truncated.
SQL> |