Ticker

6/recent/ticker-posts

SQL Tutorial - Basic Difference Between Delete And Truncate in Oracle Database

Difference Between Delete And Truncate in Oracle

Today, We Explore some Basic Difference Between Delete and Truncate in Oracle Database.

What is Delete Command?

Delete command is used to remove rows from the table and Use Where clause for delete some specific row.

What is Truncate Command?

The truncate command is used to remove all the rows. We can't use the Where clause in truncate command.

Generally Both the Command Truncate and Delete used to remove data from the table but here some basic differences between Delete and Truncate in Oracle Database.

Difference Between Delete and Truncate in Oracle Database

Delete Command
  1. Delete is a DML command.
  2. Delete is used to delete a particular record as well as all records also.
  3. Delete is not an auto-commit statement.
  4. The delete can be used with a WHERE Clause.
  5. Database trigger fired on Delete Statement.
  6. Delete Command is slow.
  7. Delete Command can be the rollback.
Truncate Command
  1. Truncate is a DDL command.
  2. Truncate is used to delete or remove all data into a table.
  3. Truncate is an auto-commit statement.
  4. Truncate can’t be used with a WHERE clause.
  5. Truncate releases the storage space.
  6. The database trigger does not fire on Truncate Statement.
  7. Truncate Command is Faster.
  8. The truncate command cannot be the rollback.
That's all for today, I think this Basic Difference Between Delete And Truncate in Oracle Database post will helpful for you. If you like this post then share your view in the comment box. Also, Share this post with your friends.

Post a comment

0 Comments