what is the difference between TRUNCATE and DELETE command
Answers were Sorted based on User's Feedback
Answer / guest
Truncate command cannot be rolled back while Delete can be
|Is This Answer Correct ?||178 Yes||18 No|
Answer / pavan_1981
truncate is ddl command.its faster than delete as it doesnt
have go through the rollbacks etc.truncate being a ddl is
auto commit.we can only truncate the whole table(cant use
where clause).once table is truncated we cant rollback the
changes.when a table is truncated the memory occupied is
released.that id the water mark is adjusted.
delete is a dml command and can be rolled back.is slower
than truncate as it is dml has to go through rollback
segments etc.we can use where clause with delete.when a
table is deleted memory occupied is not released ans also
the water mark is not adjusted.
|Is This Answer Correct ?||153 Yes||11 No|
Answer / mkjmkumar
1. It is DDL.
2. Speed is faster
3. Do not Check Constraints.
4. Roll Back is not possible.
5. Can not use where clause
1. It is not a DDL
2. Speed is slow
3. Check constraints, If Exists then shoe error.
4. We can rollback .
5. User Where Clause
|Is This Answer Correct ?||78 Yes||8 No|
Answer / kotravel. b
1 cannot be 1 can ba RB
2 faster than 2 slower than truncate
3 it releses the stroge 3 it does not releses the stroge
|Is This Answer Correct ?||75 Yes||8 No|
Answer / nithya
The delete statement will result in the table spaces or
memories would remain as the current size and table
structure remain in the database. Delete is not effective
when you use it to remove all data from a table, because it
takes up storage spaces due to unclear memories.
The truncate statement will result in clearing table spaces
or memories and the table structure remain in the database.
Therefore it free table storage spaces and use it only when
you need to remove all data from a table.
|Is This Answer Correct ?||24 Yes||3 No|
Answer / anup.wilson
hii every one ... i want to say that delite is --dml and
truncate is ddl ..nxt thing about roll back ..through
delete we roll back untill unless we are not COMMIT IT..
IF WE COMMIT AFTER DELETE ..WE CANT ROLL BACK IT
|Is This Answer Correct ?||15 Yes||3 No|
Answer / dheeraj
Delete is DML Command ,Whereas Trucate is DDL command
Delete can be Rolled Back,Truncate cannot be rolled back,
Truncate is much faster then Delete
Delete will not released the memory space ,Memories would
be same if we use delete command the structure of the
table is still there
Trncate can be free the space in the meomory
Delete , use check constraints if exits then show error
Truncate don't use check constraint
|Is This Answer Correct ?||13 Yes||4 No|
1.Truncate Can be DDL Command.
2.it cannot be rollback.
3.we cann't use Where clause.
4.truncate=delete+commit so we cann't rollback.
5.truncate delete all record from the table.
6.truncate is a DDL command and cannot be rollbackand all
memory space is released back to server.
8.do not chcek constraint.
1.Delete Can be DML Command.
2.it can be rollback.
3.we can use Where clause.
4.delete=delete-- so we can be rollback.
5.delete delete record from the table.
6.truncate is a DDL command and can be rollback and all
memory space is not released back to server.
8. chcek constraint.
|Is This Answer Correct ?||14 Yes||7 No|
Answer / kavita sahu
1. Truncate is a DDL command and delete is a DML command
2. Truncate delete all records from table there is no
ROLLEDBACK it always Commit without giving the Commit
3. Truncate is much faster than Delete
4. Truncate you can't use where clause
DELETE you can use where clause
|Is This Answer Correct ?||4 Yes||0 No|
Answer / raja lakshmi reddy v
hi friends this is raja
1. Truncate is used to delete all rows at a time, so the
table will become as free. The user feel the table does not
contain any rows, eventhough but internally the data exist
some memory that memory is free for our reuse.
2. Truncate is faster than delete, and where clause never
3. It is ddl command so that it will not roll back because
auto commit by default.
4. in sqlserver autoid columns will reset since from
starting seed value.
1. Delete is used to Delete particular rows or all with
where clause or without where clause.
2. remeber if u delete rows, eventhough that memory will
never free means separate memory will allocate to our table.
3. It is slower than the truncate.
4. in sqlserver autoid values will never start from seed
intial value or default value.
5. while deleting check constrains, if any problem errow
|Is This Answer Correct ?||6 Yes||3 No|
i am working with OC 4.5 i have numbers in table in 10 row with some null values please tell me how to find total? Thanks
what is semphore explian it?
how to display last 5 letters from a name (take emp table ename )
how to create an user in oracle 10g.please give me an example..
Can we modify approve purchase order?if yes what is navigation?
How I can load an image into image item on Forms. I want to know about built-ins and procedure. and also code for it.
When creating a user, what permissions must you grant to allow them to connect to the database?
Why we are using primary key and foreign key in oracle and difference between primary key and foreign key?
the user should know to which database he is connected currently in oracle
what are basic modules required to implement oracle application in any oraganisation?
How to move the data from one flatfile to multiple staging tables?give me some examples? for example in po interface one flat file is there and multiple staging tables are there how can move it?please give me answer for this question?
What is db_recovery_file_dest in oracle? When do you need to set this value?