DML Commands That Can Be Rolled Back

Describe Each Data Manipulation Language (DML) Statement.

Which of the following commands can be rolled back?

A. COMMIT
B. DELETE
C. INSERT
D. MERGE
E. TRUNCATE
F. UPDATE

---

Answer:

A DML (Data Manipulation Language) statement is a command used to manipulate data in a database. 

Let me explain each of the Data Manipulation Language (DML) statements and which ones can be rolled back.

COMMIT: This statement is used to make permanent changes to the database. Once a COMMIT statement is executed, all changes made since the last COMMIT or ROLLBACK statement will be saved to the database and cannot be undone.

DELETE: This statement is used to remove rows from a table in the database. It can be rolled back using the ROLLBACK statement as long as the transaction that contains the DELETE statement has not been committed yet.

INSERT: This statement is used to add new rows to a table in the database. It can also be rolled back using the ROLLBACK statement as long as the transaction that contains the INSERT statement has not been committed yet.

MERGE: This statement is used to update or insert data into a table based on a condition. It can also be rolled back using the ROLLBACK statement as long as the transaction that contains the MERGE statement has not been committed yet.

TRUNCATE: This statement is used to remove all rows from a table in the database. Unlike DELETE, TRUNCATE cannot be rolled back.

UPDATE: This statement is used to modify existing data in a table in the database. It can be rolled back using the ROLLBACK statement as long as the transaction that contains the UPDATE statement has not been committed yet.

So the commands that can be rolled back are DELETE, INSERT, MERGE, and UPDATE. 

COMMIT and TRUNCATE cannot be rolled back.

Oracle Books
Oracle Certification, Database Administration, SQL, Application, Programming Reference Books

Oracle Application
Oracle Application Hints and Tips

Oracle Home
Oracle Database, SQL, Application, Programming Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.