Using Commitment control statement in SQL stored procedure in IBM i DB2 AS400



Using Commitment control statement in SQL stored procedure in IBM i DB2 AS400

Using Commitment control statement in SQL stored procedure in IBM i DB2 AS400

Using Commitment control statement in SQL stored procedure in IBM i DB2 AS400.
This video will explain the following things:
1- Pre-requisite for Commitment control
2- Transaction
3-ATOMIC
4-SAVEPOINT (‘SYS’ (SQLSTATE 42939) , UNIQUE (SQLSTATE 3B501).
5-Savepoint LEVEL
6- COMMIT
7-ROLLBACK
8-ROLLBACK TO SAVEPOINT
9-RELEASE SAVEPOINT
10-SET TRANSACTION

Example1: SAVEPOINT and ROLLBACK TO SAVEPOINT
-Create table.
-Create a journal receiver.
-Create a journal and attached the Journal receiver to it.
-Start journaling on the PF using command STRJRNPF to the Journal.
Example2: Commitment control statement that uses COMMIT and ROLLBACK.
Example3: Commitment control statement that uses BEGIN ATOMIC.
Example 4: Deleting records from table having commitment control ON.

Comments are closed.