Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Arbind.

Asked: April 26, 2017 - 12:58 pm UTC

Last updated: April 26, 2017 - 3:48 pm UTC

Version: 10

Viewed 10K+ times! This question is

You Asked

Hi Tom,

I am getting to do same action why?

TRUNCATE TABLE xyz
where to_date('12/30/1899', 'MM/DD/YYYY') + dtimestamp < to_date('01/01/2017','MM/DD/YYYY')
REUSE STORAGE;

still getting messages like

Error report:
SQL Error: ORA-03291: Invalid truncate option - missing STORAGE keyword
03291. 00000 - "Invalid truncate option - missing STORAGE keyword"
*Cause: Expected STORAGE keyword
*Action: Either specify DROP STORAGE or REUSE STORAGE

and Chris said...

You can't have a where clause with truncate! It always removes everything.

If you want to selectively wipe rows, you need delete.

Is this answer out of date? If it is, please let us know via a Comment