diff between DELETE and TRUNCATE?.
Answer Posted / pr@$@d
1 TRUNCATE is a DDL command whereas DELETE is a DML command.
2 TRUNCATE is much faster than DELETE.
Reason:
a) When you type DELETE. All the data get copied into
the Rollback Table space first. Then delete operation get
performed. That’s why when you type ROLLBACK after deleting
a table, you can get back the data (The system gets it for
you from the Rollback Table space).All this process takes
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 can’t get back
the data.
b) TRUNCATE command resets the High Water Mark for the
table but DELETE does not. So after TRUNCATE the
operations on table are much faster.
3 You can’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 can’t use conditions (WHERE clause) in TRUNCATE.But
in DELETE you can write conditions using WHERE clause
Regards,
-Pr@$@d Reddi.
prasadreddi_mca@yahoo.com
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What happens to the current transaction if the session is ended?
Explain oracle instance.
How many file formats are supported to export data?
How to handle a single quote in oracle sql?
How to check your oracle database 10g xe installation?
How do I escape a reserved word in oracle?
How to write an inner join with the where clause in oracle?
What is a named program unit?
What is oracle rownum?
What is the difference between a hot backup and a cold backup in oracle?
What happens if the imported table already exists?
Why do you use stored procedures and state some of its disadvantages?
What is the difference between a primary key & a unique key?
Why is oracle database so popular?
How to select some columns from a table in oracle?