What is difference between TRUNCATE & DELETE?
Answer Posted / oracle_tigress
difference between truncate and delete
1.truncate removes rows in one execution..delete removes
rows one by one so truncate is fast..
2.truncate does not creates logs and hence canot be
rolledback and hence is a DDL stmt..DELETE creates rollback
segment hence can be rolled back and hence is a DML stmt.
3.truncate doesnot allow for conditional remove of records
(all records has to remove) DELETE allows conditonal remove
of records(where cluase etc can be used.)
4.triggers are not fired on truncate stmt but trgieers are
fired on DELETE stmt..
| Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
What is trigger and stored procedure in sql?
Is primary key a clustered index?
What is meant by user defined function?
Where not exists in sql?
How many indexes can be created on a table in sql?
Can we use view in stored procedure?
What is prepared statement in sql?
What are the set operators in sql?
What are system versioned tables?
how many triggers are allowed in mysql table? : Sql dba
Do we need to rebuild index after truncate?
Explain autonomous transaction.
What is multiple partition?
Explain the steps needed to create the scheduled job?
what is innodb? : Sql dba