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 ? | 8 Yes | 2 No |
Post New Answer View All Answers
Give the syntax of exception handling used in DBMS?
What are different types of blocks used in stored procedure?
Two tables emp(empid,name,deptid,sal) and dept(deptid,deptname) are there.write a query which displays empname,corresponding deptname also display those employee names who donot belong to any dept.
What is the Lock Based Protocol used for?
How to do Stored procedure testing? Who does this testing (Developer or tester)?
What are different types of clusters present?
If the master device is full, how do I make the master database bigger?
i applied prompt on country when i run report it shows list of all countries but want it to show only four countries name
What is replicaset?
What is the DIF format and when we will use in teradata
What is Data Modelling?
Explain storage manager?
Explain database partitioning.
What is database schema name?
how to configure oracle 10g in java1.5 and tell me know how to set class path in system?