what is exact difference between drop and truncate table.
Answer Posted / chandana
Drop :
1.Deletes the entire table records as well as the table
structure.
2.It is a DDL Command.
3. Logs are not maintained.
4. Auto Commited.
5.Where clause cannot be used in the Drop statement.Synatx:
Drop table <Table_Name>
Trunctae:
1. Deletes the entire table records ,retains the table
structure.
2. Its a DDL Command.
3. Logs are not maintained. So faster in performace than
Delete.
4. Auto Commited.
Cannot be Rolled Back.
5.Where clause cannot be used with truncate statement.
Truncate Table <Table_Name>;
Delete:
1. Deletes the table records based on condtions ,retains
the table structure.
2. Its a DML Command.
3. Logs are maintained.So slower than trucate.
4. No Auto Commited.So can be Rolled Back.
5.Where clause can be used with truncate statement.
Syantx:
Delete from <Table_Name> where <Condition>;
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
How to create an oracle database manually?
Is a rollback possible to any savepoint?
Can we insert data in view oracle?
What is the difference between count (*), count (expression), count (distinct expression)?
how do u setup a replication site?
Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?
Using the relations and the rules set out in the notes under each relation, write statements to create the two sequence generators specified in the notes.
In Oracle Clinical 4.5.0, can the VIEW_TEMPLATE_ID column in DATA_EXTRACT_VIEWS table contain NULL value?
Explain a synonym?
How to create a table index in oracle?
What is a trace file and how is it created in oracle?
What is the parameter mode that can be passed to a procedure?
What is tns entry?
How do you get nicely formatted results from an oracle procedure that returns a reference cursor?
How to resolve the ORA-39133 error in Oracle?