Transaction Control Language
Summary
Transaction control language is used to control the transactions performed on the database. TCL can save or revoke the transactions applied on the database from sync point. Sync point is nothing but where the COMMIT or ROLLBACK executed. TCL have below two statements
- COMMIT
- ROLLBACK
COMMIT -
COMMIT is used to save all transactions performed on database from the SYNC point.If the COMMIT performed then the changes performed from the SYNC point will be made as permanent.COMMIT can also closes all the open cursors at the point of COMMIT executes except the cursors WITH HOLD.
Syntax -
EXEC SQL
COMMIT
END-EXEC.
ROLL BACK -
ROLLBACK is used to revert back all transactions performed on database from the SYNC point.If the ROLLBACK performed then the changes performed from the SYNC point will be reverted back.
Syntax -
EXEC SQL
ROLLBACK
END-EXEC.