What is difference between TRUNCATE & DELETE
Answer posted by Scott on 2005-05-25 18:30:04: TRUNCATE is a DDL command and cannot be rolled back. All of the memory space is released back to the server.
DELETE is a DML command and can be rolled back.
Both commands accomplish identical tasks (removing all data from a table), but TRUNCATE is much faster.
Editorial / Best Answer
Answered by: Prangya Sahu
1>TRUNCATE is a DDL command whereas DELETE is a DML command.
2>TRUNCATE is much faster than DELETE.
Reason:When you type DELETE.all the data get copied into the Rollback Tablespace first.then delete operation get performed.Thatswhy when you type ROLLBACK after deleting a table ,you can get back the data(The system get it for you from the Rollback Tablespace).All this process take time.But when you type TRUNCATE,it removes data directly without copying it into the Rollback Tablespace.Thatswhy TRUNCATE is faster.Once you Truncate you cann't get back the data.
3>You cann't rollback in TRUNCATE but in DELETE you can rollback.TRUNCATE removes the record permanently.
4>In case of TRUNCATE ,Trigger doesn't get fired.But in DML commands like DELETE .Trigger get fired.
5>You cann't use conditions(WHERE clause) in TRUNCATE.But in DELETE you can write conditions using WHERE clause.
- Oracle cursors in PL/SQL
- Difference between active & reactive power meters
- Difference between 11i and r12
- Dataset stage and sequential file stage
- What is the difference between trigger and constraints ?
- What is the difference between pass data item value and pass parameter value ?
- What is the difference between page not found and page cannot be dislplayed
- Master data goverance
- What is difference between microprocessor and microcontroller?
- Delete duplicate records without using sub query?
- What is the difference body & neutral earthing ?
- What are the basic difference between re-insurance and insurance claim handling?
- Business rule & business validation
- What is the difference between subnetmask and host
- Microstrategy differences
- What is the difference between a Java developer and Java designer?
- Cash management service
- Is there any difference between web application testing and sharepoint application testing.
- Difference between Informatica 8.1 and 8.6 in briefly
- Worksoft certify