what is difference between delete and truncet ?

Answer Posted / shivaleela

DELETE:-

1.it is a DML stmt
2.it can include WHERE condition
3.it is only delete, so it can be rolled back can be ROLL
BACK

TRUNCATE:-

1.it is a DDL stmt
2.it can not include WHERE cnd
3.it is delete+commit ,so we cant roll back can not be ROLL
BACK


Both commands accomplish identical tasks (removing all data
from a table), but TRUNCATE is much faster

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.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the disadvantages of views in a database?

623


What is database client?

634


How heap is implemented in database?

722


Explain partial key?

730


What is odm database?

639






How do database connections work?

585


What is dialect in database?

623


how to reject duplicates in source sequential file and if by filter option then where is that filter option in the sequential file.

1186


What is the Difference Primary key and Unique Key

658


What is a super key?

708


How do you pass parameter in stored procedure?

809


Explain data independence & its types.

682


Is data lake a database?

645


Re: Where can i get informatica certification Exam dumps and details? please forward it to emailid:

1899


What is database server and how it works?

637