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


Please Help Members By Posting Answers For Below Questions

what is the difference between myisam static and myisam dynamic? : Sql dba

581


In what condition is it good to disable a trigger?

548


what is a foreign key ? : Sql dba

603


1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins

1146


What is substitution variable in pl sql?

494






Explain the components of sql?

587


Does sql full backup truncate logs?

527


Is progress software supports to ( pl/sql )?

521


What is sql basics?

573


How do I restart sql?

519


What does := mean in pl sql?

551


Inline the values in PL/SQL, what does it mean.?

625


what is the difference between join and union? : Sql dba

543


What is the cause of mutating table error and how can we solve it?

594


How to select random rows from a table?

518