Showing posts with label DB2 Interview. Show all posts
Showing posts with label DB2 Interview. Show all posts

Truncate Vs Delete in database

1) Truncate is a DDl Statement
Delete is a DML statement
2) Truncate commits after deleting the entire table . So deleted Records can not be rolled back .
No Commit is performed after deleting the records . So it can be rolled back
3) Truncate is faster than Delete as it does not generte roll back segments
Delete is slower because it generates roll back segments.
4) where condition can't be used with truncate.it deletes entire table.
Where condition can be used with Delete statement.
Read more...

 
Copyright 2011 Java Online