ORACLE: TRUNCATE TABLE [EN]
top of page
CerebroSQL

Oracle:

TRUNCATE TABLE

Description:
The TRUNCATE TABLE command is used to remove all records from a table. An analogue of this command is the DELETE command, only without the WHERE conditions.

Warning: If you clear a table with the TRUNCATE TABLE statement, it cannot be rolled back.

It is important to understand that the TRUNCATE command is fast and does not create entries in the redo file (REDO)

Syntax:
TRUNCATE TABLE [schema.] table
[ {PRESERVE | PURGE} MATERIALIZED VIEW LOG ]
[ {DROP [ ALL ] | REUSE} STORAGE ] ;

Example

TRUNCATE TABLE employees_demo;

TRUNCATE TABLE sales_demo PRESERVE MATERIALIZED VIEW LOG;

TRUNCATE TABLE orders_demo;

bottom of page