- DELETE operation remove some or all rows and need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it. will cause all DELETE triggers on the table to fire.
- TRUNCATE removes all rows from a table and no DML triggers will be fired.
- DROP removes a table from the database, indexes and privileges, No DML triggers will be fired.
- DROP and TRUNCATE are DDL commands, DELETE is a DML command.
Therefore DELETE operations can be rolled back (undone), while DROP and TRUNCATE operations cannot be rolled back. - TRUCATE is faster and doesn't use as much undo space as a DELETE.
- Specify CASCADE CONSTRAINTS to drop all referential integrity constraints(at the detail table) that refer to primary and unique keys in the dropped table. If you omit this clause, and such referential integrity constraints exist, then the database returns an error and does not drop the table.
drop table Dept cascade constraints
http://www.orafaq.com/faq/difference_between_truncate_delete_and_drop_commands
No comments:
Post a Comment