Difference Between DELETE and TRUNCATE Commands in Oracle
In Oracle, DELETE and TRUNCATE are both commands used to remove data from a table, but they have some key differences:
DELETE Command:
The DELETE command is a DML (Data Manipulation Language) statement used to remove specific rows from a table based on a condition.
Deletes can be rolled back using a ROLLBACK statement if necessary.
DELETE command does not reset the sequence numbers in the table.
TRUNCATE Command:
The TRUNCATE command is a DDL (Data Definition Language) statement used to remove all rows from a table.
TRUNCATE operation is faster than DELETE as it does not generate individual row deletions in redo logs.
TRUNCATE command cannot be rolled back.
Therefore, the main difference between DELETE and TRUNCATE in Oracle is that DELETE is used to remove specific rows while TRUNCATE is used to remove all rows from a table.
Please login or Register to submit your answer