What is TRUNCATE Command in Oracle?
- TRUNCATE command in SQL is used to delete Values from the specific table.
- TRUNCATE Command once applied on the table, locks that table. Thus, deleting all the rows of the table at a single go.
- TRUNCATE is a DDL command that once applied cannot roll back the values.
- No, WHERE clause is used with this command.
- The command does not affect the structure of database
Syntax
TRUNCATE TABLE Table_name;
Example
For instance, we have a table Temp as shown below:
And we want to delete all the values in a table. For that, we can use TRUNCATE Command. We can perform the following command by the code below:
TRUNCATE TABLE Temp;
Output
After applying the Select statement we will find the table as:
Related Content