Answered Questions

  • What is the difference between delete,drop and truncate?

    Amit

    • Aug 28th, 2016

    Adding 2 cents 1) DELETE is DML command because it does not change data dictionary (Every command which changes data dictionary tables is called DDL command ) TRUNCATE is DDL command is changes stor...

    Ashakant Kendre

    • May 9th, 2016

    1>TRUNCATE is a DDL command whereas DELETE is a DML command. 2>TRUNCATE is much faster than DELETE. Reason: When you type DELETE. All the data get copied into the Rollback Tablespace first, then del...

  • What is difference between TRUNCATE & DELETE ?

    TRUNCATE commits after deleting entire table i.e., can not be rolled back. Database triggers do not fire on TRUNCATEDELETE allows the filtered deletion. Deleted records can be rolled back or committed.Database triggers fire on DELETE.

  • What is difference between TRUNCATE & DELETE

    Answer posted by Scott on 2005-05-25 18:30:04: TRUNCATE is a DDL command and cannot be rolled back. All of the memory space is released back to the server. DELETE is a DML command and can be rolled back.  Both commands accomplish identical tasks (removing all data from a table), but TRUNCATE is much faster.

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Prangya Sahu

    • Nov 21st, 2005


    1>TRUNCATE is a DDL command whereas DELETE is a DML command.

    2>TRUNCATE is much faster than DELETE.

    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.

    3>You cann't rollback in TRUNCATE but in DELETE you can rollback.TRUNCATE removes the record permanently.

    4>In case of TRUNCATE ,Trigger doesn't get fired.But in DML commands like DELETE .Trigger get fired.

    5>You cann't use conditions(WHERE clause) in TRUNCATE.But in DELETE you can write conditions using WHERE clause.

    Shahida Sultana

    • Mar 6th, 2014

    TRUNCATE removes all rows from a table. The operation cannot be rolled back and no triggers will be fired. As such, TRUCATE is faster and doesnt use as much undo space as a DELETE.

    saravanan

    • Sep 18th, 2012

    Delete & truncate command will delete entries from a table.. where as we can delete a single entry using delete but incase of truncate it wont be possible..

    using truncate will delete the log files,buffer storage in a table permanently but incase of delete it wont