I can use delete from table_name which works.
Why not truncate?
I can use delete from table_name which works. Why not truncate ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try:
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…