Table of Contents
This chapter briefly introduces the DBMS_TRANSACTION package, and describes how to use the procedures of the package.
The DBMS_TRANSACTION package executes SQL statements that manage transactions in the tbPSM program.
For further information on the SQL statements, refer to Tibero SQL Reference Guide.
This section describes the procedures provided by the DBMS_TRANSACTION package, in alphabetical order.
Commits the current transaction.
Details about the COMMIT procedure are as follows:
Prototype
DBMS_TRANSACTION.COMMIT;
Example
BEGIN DBMS_TRANSACTION.COMMIT; END;
Rolls back the current transaction completely or to a specified savepoint.
Details about the ROLLBACK and ROLLBACK_SAVEPOINT procedures are as follows:
Prototype
Complete transaction rollback
DBMS_TRANSACTION.ROLLBACK;
Rollback to savepoint
DBMS_TRANSACTION.ROLLBACK_SAVEPOINT ( savepoint IN VARCHAR );
Parameter
Parameter | Description |
---|---|
savepoint | Savepoint name. |
Example
BEGIN INSERT INTO EMP VALUES (1, 'chulsoo'); DBMS_TRANSACTION.ROLLBACK; END;
Specifies a new savepoint for the current transaction.
Details about the savepoint procedure are as follows:
Prototype
DBMS_TRANSACTION.SAVEPOINT ( savepoint IN VARCHAR );
Parameter
Parameter | Description |
---|---|
savepoint | Savepoint name. |
Example
BEGIN DBMS_TRANSACTION.SAVEPOINT('sp1'); INSERT INTO EMP VALUES (2, 'younghee'); DBMS_TRANSACTION.ROLLBACK_SAVEPOINT('sp1'); END;