Oracle Truncate Table | Truncate Table - oracle tutorial - sql tutorial
Learn oracle - oracle tutorial - Oracle truncate table - oracle examples - oracle programs
What is TRUNCATE TABLE statement in oracle ?
- TRUNCATE TABLE statement is used to remove all records from a table in Oracle.
- It performs the same function as a DELETE statement without a WHERE clause.
Syntax:
Example
Code Explanation:
- TRUNCATE TABLE represents the Oracle Statement .
- Wikitechy is the table name which we want to truncate.
- Click on the “Run” button to execute the given query.
- The Records from the table has been deleted from the Truncate Statement.
Difference between truncate and delete:
- All the tables' rows, indexes and privileges will also be removed.
- No DML triggers will be fired.
- DROP and TRUNCATE are DDL commands,whereas DELETE is a DML command.
- Therefore DELETE operations can be rolled back (undone), while DROP and TRUNCATE operations cannot be rolled back.