1. Enable auto commit
db2 => update command options using c on
DB20000I The UPDATE COMMAND OPTIONS command completed successfully.
2. Disable auto commit
db2 => update command options using c off
DB20000I The UPDATE COMMAND OPTIONS command completed successfully.
3. Check auto commit status
db2 => LIST COMMAND OPTIONS
Command Line Processor Option Settings
Backend process wait time (seconds) (DB2BQTIME) = 1
No. of retries to connect to backend (DB2BQTRY) = 60
Request queue wait time (seconds) (DB2RQTIME) = 5
Input queue wait time (seconds) (DB2IQTIME) = 5
Command options (DB2OPTIONS) =
Option Description Current Setting
------ ---------------------------------------- ---------------
-a Display SQLCA OFF
-c Auto-Commit ON
-d Retrieve and display XML declarations OFF
-e Display SQLCODE/SQLSTATE OFF
-f Read from input file OFF
-i Display XML data with indentation OFF
-l Log commands in history file OFF
-m Display the number of rows affected OFF
-n Remove new line character OFF
-o Display output ON
-p Display interactive input prompt ON
-q Preserve whitespaces & linefeeds OFF
-r Save output to report file OFF
-s Stop execution on command error OFF
-t Set statement termination character OFF
-v Echo current command OFF
-w Display FETCH/SELECT warning messages ON
-x Suppress printing of column headings OFF
-z Save all output to output file OFF
-c Auto-Commit ON
It means current auto commit status is enabled.
本文介绍如何在DB2数据库中启用、禁用自动提交功能,并提供了检查当前自动提交状态的方法。通过简单的DB2命令操作,用户可以灵活地控制事务的自动提交行为。
4万+

被折叠的 条评论
为什么被折叠?



