Oracle TRUNCATE TABLE
In Oracle, TRUNCATE TABLE statement is used to remove all records from a table. It works same as DELETE statement but without specifying a WHERE clause. It is generally used when you don?t have to worry about rolling back
Once a table is truncated, it can?t be rolled back. The TRUNCATE TABLE statement does not affect any of the table?s indexes, triggers or dependencies.
1) schema_name: This parameter specifies the name of the schema that the table belongs to. It is optional.
2) table_name: It specifies the table that you want to truncate.
Oracle TRUNCATE Table Example
Consider a table named "customers" and execute the following query to truncate this
Table truncated. 1.11 seconds
Now check the customers table, you will find that there is no data available in that table. It is equally similar to DELETE TABLE statement in Oracle.
Oracle DELETE Table Example
TRUNCATE TABLE vs DELETE TABLE
Both the statements will remove the data from the "customers" table but the main difference is that you can roll back the DELETE statement whereas you can't roll back the TRUNCATE TABLE statement.