Difference between COMMIT and ROLLBACK in PL/SQL
COMMIT and ROLLBACK are two important commands in PL/SQL that are used to manage transactions.
COMMIT: When the COMMIT command is executed, all the changes made in the current transaction are permanently saved to the database. It marks the successful end of the transaction and makes the changes permanent.
ROLLBACK: On the other hand, when the ROLLBACK command is executed, all the changes made in the current transaction are undone or rolled back. It reverts the database to its state before the transaction started.
Therefore, the main difference between COMMIT and ROLLBACK is that COMMIT saves the changes made in the transaction, while ROLLBACK discards the changes.
It is important to use COMMIT carefully as it can make the changes permanent, whereas ROLLBACK can be used to undo changes in case of errors or issues during the transaction.
Please login or Register to submit your answer