• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Delete Vs Truncate Vs Drop

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


Difference between Delete,Truncate and Drop is


Delete is DML statetment.it only removes the data from table and can use WHERE Clause with it and it can be rolled back.
Truncate is DDL statement .This command delete data from the table .but leaves table structure for future use.It cannot be rolled back
.
Drop is DDL statement .It removes the table from data dictionary and as well drop the storage held by this table.It cannot be rolled back...

am i correct or missing something ,then please correct me...

Thanks in advance
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's roughly correct.

TRUNCATE can be used on a single partition too (if you have a partitioned table). And since it is a DDL operation, it doesn't need to generate any undo, which makes it a very fast operation even for tables containing millions of rows.

Since Oracle 10, it is possible to undo a DROP TABLE statement (not TRUNCATE though). If you're interested, see Oracle Flashback Technology.
 
priyanaka jaiswal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Martin
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic