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 |
1.In a table Gender is a column in that male and female are the two data.In a single statement i have to modify all male to female and all female to male vice versa. 2.In a single query i need the count of male data,count of female and total count
What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?
Differentiate between earned discounts and unearned discounts? : oracle accounts receivable
I've got a database 10g and Form version 5.0 but unable to connect. Does Oracle 10g database supports form 4.5
Is Oracle 7.3 is a single user or multi user..Is it possible to use this as a backend for web applications?
CAN AUNIVERSE BE LINKED TO MORE THAN ONE DATASOURCE?
What is the difference between recovery and restoring of the oracle database?
How would you determine who has added a row to a table?
8. Supporting AP, AR and GL?
What is mrc and what is its use? : oracle accounts receivable
PURCHASE ORDER TO PAYABLES WHAT ENTREIS WILL HAVE
what is difference between inner join & nested query or subqueries