db2 tip -- Cancel the auto commit in CLP

In DB2 CLP, the auto commit is on by default. In fact we often need commit or rollback by manual therefore canceling the auto commit is very meaning.

How to update the option?

1. Come into CLP

[db2inst1@dxzq10 ~]$ db2

@DB2INST1 =>

2. Update CLP command option

@DB2INST1 =>update command options using c off;
DB20000I The UPDATE COMMAND OPTIONS command completed successfully.

3. list the options and validate the modification.

@DB2INST1 =>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 OFF
-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 ON
-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

Note

The auot commit is an option reside the CLP client. It is not same as the DB2Prompt, which is a option of local register repository. That means if we quit DB2 CLP the option will be restore the default. And the auto commit will be on again while we come into db2 CLP next time.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值