What is the difference between DELETE and TRUNCATE?

Answer Posted / brajendra arzare

Deletes perform normal DML. That is, they take locks on
rows, they generate redo and they require segments in the
UNDO tablespace. Deletes clear records out of blocks
carefully. If a mistake is made a rollback can be issued to
restore the records prior to a commit.
Truncates are DDL and truncate moves the High Water Mark
of the table back to zero. No row-level locks are taken, no
redo or rollback is generated.so they have the same effect
as a delete, but without all the overhead. Just one slight
problem: a truncate is a DDL command, so you can't roll it
back if you decide you made a mistake. (It's also true that
you can't selectively truncate -no "WHERE" clause is
permitted, unlike with deletes, of course).

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the advantages and disadvantages of stored procedure?

853


What is string data type in sql?

724


how to get a list of all tables in a database? : Sql dba

692


List and explain the different types of join clauses supported in ansi-standard sql?

1030


what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba

862






How can check sql version from command line?

720


Can a commit statement be executed as part of a trigger?

797


Lookups are a key component in sql server integration services (ssis). Explain its purpose?

752


what are the differences between require and include, include_once and require_once? : Sql dba

743


Can procedure in package be overloaded?

837


Can pl sql procedure have a return statement?

722


Is foreign key mandatory?

712


what is sub-query? : Transact sql

839


What is the difference between instead of trigger and after trigger?

697


I need a function for a train ticket reservation please answer it thanks in advance

758