DELETE
DELETE is used to remove exiting rows from a table.
DELETE FROM TableName
WHERE condition;
If we omit the WHERE clause all rows in the table are deleted otherwise specific rows are deleted based on the condition. After performing a DELETE operation we need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it.
NOTE: All DELETE triggers on the table will fire.
DROP
DROP is used to delete the definition of oracle table.When we drop a table,the database loses all the data in the table and all the indexes associates with it.
DROP TABLE TableName
After dropping table any views and synonmys are still remained there but are invalid.
TRUNCATE
TRUNCATE is used to remove all rows from a table and release the storage space used by the table.
TRUNCATE TABLE TableName
NOTE:DROP and TRUNCATE are DDL but DELETE is DML.So when we use TRUNCATE we cannot roll back row removed and even no triggers will be fired.
DELETE is used to remove exiting rows from a table.
DELETE FROM TableName
WHERE condition;
If we omit the WHERE clause all rows in the table are deleted otherwise specific rows are deleted based on the condition. After performing a DELETE operation we need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it.
NOTE: All DELETE triggers on the table will fire.
DROP
DROP is used to delete the definition of oracle table.When we drop a table,the database loses all the data in the table and all the indexes associates with it.
DROP TABLE TableName
After dropping table any views and synonmys are still remained there but are invalid.
TRUNCATE
TRUNCATE is used to remove all rows from a table and release the storage space used by the table.
TRUNCATE TABLE TableName
NOTE:DROP and TRUNCATE are DDL but DELETE is DML.So when we use TRUNCATE we cannot roll back row removed and even no triggers will be fired.
No comments:
Post a Comment