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 |
QUESTION IS THAT DURING UPLOADING DATA IN PROD SERVER,OUR EQUIPMENT TAG NUMBERS ARE NOT MATCHING WITH SAP TAG NUMBERS SO DUE TO THIS WE ARE FACING PROB, BECAUSE WHENEVER ALARM IS COMING FROM SCADA DUE MISMATCH THE NOTIFICATION IS NOT CREATED IT IS GIVING ERROR. PLEASE SUGGEST THE METHOD SO THAT THE TAG NUMBERS OF BOTH (SCADA EQUIPMENT AND SAP EQUIP) SHOULD CONCIDE.OTHERWISE WE HAVE TO GO FOR LONG PROCESS EITHER BY INTERFACE TABLE OR BY EXPORTING ALL DATA AND MAKING RIGHT CHANGES.DO YOU HAVE ANY SHORTCT METHOD PL WRITE ME. THANKS
What is cardinality?
What is autocashrule set? : oracle accounts receivable
How many segment are present in Oracle Manufacturing
Explain prerequisites and post activities of oracle database installation
IS IT POSSIBLE TO CREATE REPORTS FROM DIFFERENT UNIVERSES IN ONE DOCUMENT?
CAN AUNIVERSE BE LINKED TO MORE THAN ONE DATASOURCE?
What is database schema?
How can you enable a trace for a session?
what are the advantages of Oracle over other databases..? please give me reply...
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?
can we use lexical perameter in oracle plsql if yes how