GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 54 of 171    Print  
Differentiate between TRUNCATE and DELETE
TRUNCATE deletes much faster than DELETE

TRUNCATE

DELETE

It is a DDL statement
It is a DML statement
It is a one way trip,cannot ROLLBACK
One can Rollback
Doesn't have selective features (where clause)
Has
Doesn't fire database triggers
Does
It requires disabling of referential constraints.
Does not require



  
Total Answers and Comments: 13 Last Update: September 27, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
September 03, 2005 04:27:33   #1  
shiva        

RE: Differentiate between TRUNCATE and DELETE
Once we Use Truncate we can't get the data back. But if we use Delete we can undo the data
using rollback.

 
Is this answer useful? Yes | No
October 19, 2005 02:38:22   #2  
Saravanan        

RE:
Differentiate between TRUNCATE and DELETE

shiva Wrote:Once we Use Truncate we can't get the data back. But if we use Delete we can undo the data
using rollback.

High Water Mark of the table back to zero High water mark is not affceted in delete .

 
Is this answer useful? Yes | No
October 22, 2005 05:48:32   #3  
Sampath        

RE: Differentiate between TRUNCATE and DELET...

Truncate deletes all the records at one go delete statement can delete specific rows or all rows.

Truncate is DDL and delete is DML


 
Is this answer useful? Yes | No
December 03, 2005 11:49:55   #4  
prasanna        

RE: Differentiate between TRUNCATE and DELET...

Truncate delete

it remove delete keep the tablespace

table space


 
Is this answer useful? Yes | No
January 04, 2006 04:41:30   #5  
sithusithu Member Since: December 2005   Contribution: 161    

RE: Differentiate between TRUNCATE and DELET...

DELETE: You can rollback

TRUNCATE : You can't rollback

Sithu


 
Is this answer useful? Yes | No
February 16, 2006 11:11:44   #6  
sreelakshmiI        

RE: Differentiate between TRUNCATE and DELET...

delete is a dml statement

truncate is a ddl statement

delete is mainly used to delete the records truncate is used to dele the table completel y but structure remains same.

we can get back the deleted recods by using roll back command whereas rollback does not work for truncate


 
Is this answer useful? Yes | No
April 05, 2006 01:54:41   #7  
Rana        

RE: Differentiate between TRUNCATE and DELET...

Truncate and Delete are used for deleting data

Difference is

  • Auto commit in Truncate. No auto commit in Delete.
  • Truncate is faster when compare to delete.
  • Truncate -> High Water Mark set to ZERO

 
Is this answer useful? Yes | No
August 24, 2006 16:32:12   #8  
vin        

RE: Differentiate between TRUNCATE and DELET...
If you have delete triggers they will be fired when we run the delete command but not with Truncate
 
Is this answer useful? Yes | No
September 24, 2006 14:18:48   #9  
sajin        

RE: Differentiate between TRUNCATE and DELET...
in delete the table structure also go but in truncate the table structure will be remain.
regards
sajin

 
Is this answer useful? Yes | No
January 08, 2007 05:02:07   #10  
reks        

RE: Differentiate between TRUNCATE and DELET...

truncate is a DDL statement.Delete ia DML statement

Truncate works faster than delete as data need not be written to rollback segments.

Trunacte cannot be rolled back delete can be rolled back

Truncate releases storage space delete doesnt release storage space

Truncate does not work when foriegn key is enabled

Delete trigger does not fire on truncate

Truncate requires DELETE TABLE privilege if the user does not own the table


 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape