PL/SQL: Transactions Cheat Sheet

Using COMMIT

The commit command permanently changes the data in the database.

Commit;

By default, automatic commit for DML commands is off. The automatic commit for DML commands can be set by using the following command

SET AUTOCOMMIT ON; 
-- and to turn it off
SET AUTOCOMMIT OFF;
Using ROLLBACK
ROLLBACK [TO SAVEPOINT < savepoint_name>]; 
Using SAVEPOINT
SAVEPOINT < savepoint_name >;

Leave a Reply

Your email address will not be published. Required fields are marked *