I can use delete from table_name
which works.
Why not truncate
?
Asked
Active
Viewed 750 times
1

Burhan Ali
- 2,258
- 1
- 28
- 38

Pop Stack
- 926
- 4
- 19
- 27
-
Foreign-key reference... second-half of your answer... – Pop Stack Mar 02 '12 at 11:21
-
Related question: http://stackoverflow.com/q/9519432 – Alex Poole Mar 02 '12 at 12:13
1 Answers
5
Try:
TRUNCATE TABLE <tablename>;
after disabling the FK constraint.
Truncating cannot be rolled back as it is DDL rather than DML so be careful. It also resets the highwater mark of the table being truncated.
see here for the Oracle docs explanation. and here for a comparison.
N.B.: You cannot truncate the parent table of an enabled foreign key constraint. You must disable the constraint before truncating the table. An exception is that you can truncate the table if the integrity constraint is self-referential.
From the Oracle documantation.
Hope it helps...

Ollie
- 17,058
- 7
- 48
- 59