msimons4
asked on
Truncate table
When you truncate a table does it automatically delete the child records or are the child's table FK consstraints disabled?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
drop table tab1 purge;
create table tab1(col1 char(1) primary key);
drop table tab2 purge;
create table tab2(col1 char(1), constraint tab2_fk foreign key(col1)
references tab1(col1) on delete cascade);
insert into tab1 values('a');
insert into tab2 values('a');
commit;
truncate table tab1;
delete from tab1;