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 function, procedure and package in pl/sql?

560


Can you join views in sql?

541


What is inner join in sql?

584


Which is better trigger or stored procedure?

502


where are cookies actually stored on the hard disk? : Sql dba

579






How much ram can sql express use?

508


Is sql workbench free?

531


Define sql delete statement.

563


What is rownum and rowid?

567


What is the purpose of a secondary key?

506


What are tables in sql?

549


What are sql functions? Describe the different types of sql functions?

556


How do I partition in sql?

537


What are %type and %rowtype for?

616


What is denormalization in a database?

592