Free Jobs
Reference




Java Forums: Core Java (15) J2EE (3) EJB (5) Servlet (3) JDBC (6) Hibernate (2) Struts (1) Swing (1) Oracle (7) JSP (4) Other (10)

Topic: How to differentiate among TRUNCATE, DELETE and DROP commands in oracle

To get the Posted Questions details daily in your mail Click Here

Share this Post on Facebook/Twitter/Orkut Bookmark and Share





User: pankaj244 Post Date: 02 Nov 2010 09:03

Introduction:
DDL stands for Data Definition Language
The keywords TRUNCATE, DELETE and DROP appear similar
however there is lot of difference among them.
we will understand the difference among these three in this article.




Main Content:
DELETE :
The DELETE command is used to remove some or all rows from a table.
A WHERE clause can be used to only remove some rows
DELETE triggers on the table can fire.
DELETE can be rolled back.


TRUNCATE:
The TRUNCATE command is used to remove all rows from a table.
TRUNCATE is faster than delete in case you have to delete all the rows.
triggers on the table can not be fired.
TRUNCATE can not be rolled back.


DROP:
The DROP command is used to remove all rows from a table and
the table itself from the database.
triggers on the table can not be fired.
DROP can not be rolled back.


.



Conclusion:
Thus we found that these commands are quite different and should be used
according to their respective need



About Writer:
Hi , I am Oracle Developer From Bangalore


Writer's Link:

Writer's Email:







Comments:
Post Comment





Similar Articles Top ArticlesLatest Articles Other Articles by this Author







www.freejobsreference.com Copyright © 2009-2011 | All Rights Reserved
All content of this website is protected by copyright laws and should not be reproduced in any form or by any means without written permission
(Best viewed in IE 8.0+ or Firefox 3.0+ at resolution of 1024 * 768 or higher)