Compare and contrast TRUNCATE and DELETE for a table.
Answers were Sorted based on User's Feedback
Answer / mkjmkumar
Delete :
1. It is a DML
2. Speed is Slow
3. We can Use Where Clause.
4. Check Constraints Before delete.
Truncate
1. It is a DDL.
2. Speed is Fast
3. We Cant Use Where Clause
4. Delete All Rows without check of constraints.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / zikku
Truncate command permanently deletes the information from a
table even after rollback we can't get that information.
Delete command temporarily deletes information from a table
after rollback we can get the information back.
| Is This Answer Correct ? | 5 Yes | 0 No |
DELETE: IT IS A DML COMMAND(DATA MANIPULATION LANGUAGE) .
IT DELETES DATA MEANS (DELETES ALL RECORDS) IN TABLE.
BUT STRUCTURE WILL BE THERE.
AND
DATA DELETES TEMPERORLY.
THEN USE ROLLBACK WE CAN GET THE DATA.
TRUNCATE: IT IS A DDL COMMAND (DATA DEFNITION LANGUAGE).
TRUNCATE ALL RECORDS IN A TABLE.
BUT STRUCTURE WILL BE THERE.
BUT DATA GOES PERMINANTLY.
WE CANT USE ROLLBACK HERE.
IT SHOLUD NOT WORK. WHY BCZ DATA TRUNCATES
PERMENANTLY.
| Is This Answer Correct ? | 1 Yes | 0 No |
How do you create a credit note against an invoice? : oracle accounts receivable
What is cardinality?
How would you go about increasing the buffer cache hit ratio?
A Table has 10,000 records,How can i get latest 10 dates from the table.so that i can only store those 10 records in to my Resultset Object,to reduce load on my app?
What is the use of transaction flexfield in autoinvoice? : oracle accounts receivable
Explain how to account for bank charges deducted from amount received against an invoice. : oracle accounts receivable
How client makes connection with server in client/server architecture?
How many segment are present in Oracle Manufacturing
Where would you look for errors from the database engine?
what is domain in database and its benefits?
Explain how to close periods in ar. : oracle accounts receivable
WHAT ALL DIFFERENT KIND OF FUNCTIONS AVAILABLE WHILE DESIGN UNIVERSES?