What is equivalent to SQL Server transactions in DB2?

What is equivalent to the following SQL Server operations in DB2?

  • Transaction Start
  • Commit transaction
  • Transaction rollback
+3
source share
2 answers

See here for an example. But mostly

BEGIN TRANSACTION
COMMIT TRANSACTION
ROLLBACK
+5
source

The answer is actually a little more complicated than what is indicated here. True, transactions are standardized by ANSI, and DB2 can support them.

DB2 for z/OS (LUW, Linux-Unix-Windows, ). , DB2 . - IBM, , , . , , OP, z/OS, BEGIN TRANSACTION.

, , DB2 z/OS, : DB2 . BEGIN TRANSACTION . ( ) ( - GUI, Toad, , ).

9.1 z/OS SQL (. 28; http://www-01.ibm.com/support/docview.wss?uid=swg27011656#manuals):

" . , - , . , . , ".

, , - .

:

 SAVEPOINT A ON ROLLBACK RETAIN CURSORS;

 UPDATE MYTABLE SET MYCOL = 'VAL' WHERE 1;

 ROLLBACK WORK TO SAVEPOINT A;

, . . , .

+14

Source: https://habr.com/ru/post/1707444/


All Articles