DB2非自动提交与自动提交的写法
来源:互联网 发布:windows防火墙怎么打开 编辑:程序博客网 时间:2024/05/23 17:23
DB2:非自动提交
1、非实例schema测试:
[db2inst9@th1 ~]$ db2 +C "select * from bbb.bbb"
ID
-----------
1
5
2 record(s) selected.
[db2inst9@th1 ~]$ db2 +C "insert into bbb.bbb values (9)"
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from bbb.bbb"
ID
-----------
1
5
9
3 record(s) selected.
[db2inst9@th1 ~]$ db2 rollback
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from bbb.bbb"
ID
-----------
1
5
2 record(s) selected.
[db2inst9@th1 ~]$ db2 +C "delete from bbb.bbb where id=5"
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from bbb.bbb"
ID
-----------
1
1 record(s) selected.
[db2inst9@th1 ~]$ db2 rollback
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from bbb.bbb"
ID
-----------
1
5
2 record(s) selected.
2、实例schema测试
[db2inst9@th1 ~]$ db2 values current schema
1
--------------------------------------------------------------------------------------------------------------------------------
DB2INST9
1 record(s) selected.
[db2inst9@th1 ~]$ db2 +C "select * from t2"
C1 C2
----------- --------------------
0 record(s) selected.
[db2inst9@th1 ~]$ db2 +C "insert into t2 values (1,'aa')"
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from t2"
C1 C2
----------- --------------------
1 aa
1 record(s) selected.
[db2inst9@th1 ~]$ db2 rollback
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from t2"
C1 C2
----------- --------------------
0 record(s) selected.
[db2inst9@th1 ~]$ db2 +C "insert into t2 values (1,'aa')"
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "insert into t2 values (1,'aa')"
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 commit
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from t2"
C1 C2
----------- --------------------
1 aa
1 aa
2 record(s) selected.
[db2inst9@th1 ~]$ db2 +C "delete from t2 where c1=1"
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from t2"
C1 C2
----------- --------------------
0 record(s) selected.
[db2inst9@th1 ~]$ db2 rollback
DB20000I The SQL command completed successfully.
[db2inst9@th1 ~]$ db2 +C "select * from t2"
C1 C2
----------- --------------------
1 aa
1 aa
=========================================================================================================
DB2:自动提交
db2 => set CURRENT SCHEMA aaa
DB20000I The SQL command completed successfully.
db2 => insert into bbb.bbb values (3)
DB20000I The SQL command completed successfully.
db2 => delete from bbb.bbb where id=3
DB20000I The SQL command completed successfully.
db2 => rollback
DB20000I The SQL command completed successfully.
db2 => select * from bbb.bbb
ID
-----------
1
1 record(s) selected.
- DB2非自动提交与自动提交的写法
- sqlplus 非自动提交问题
- 自动提交 与 事务
- db2关闭命令行CLP自动提交
- form的自动提交
- form的自动提交
- 表单的自动提交
- 自动提交
- WebBrowser自动填表与提交
- 【PostgreSQL-9.6.3】设置非自动提交
- 回车自动提交与禁止回车自动提交
- 回车自动提交与禁止回车自动提交
- ORACLE的自动提交问题
- POST自动提交的方法
- 自动提交表单的代码
- select 自动提交 的js
- postgresql自动提交的问题
- 修改postgresql的自动提交
- Fragment详解(六):Fragment与Menu
- 本篇文章,主要收录本人工作时iOS开发中代码写法的一些奇妙技巧,会持续更新~
- DB2在操作系统用户下创建数据库schema
- opencv2 3.2 类中实现提取蓝天颜色
- RGCDQ(线段树+数论)
- DB2非自动提交与自动提交的写法
- Pyscada---CommandLine
- java类库
- js小数运算精度问题,js浮点数运算时出现精度问题
- SVN检出maven项目,目录结构不对,解决方法(更新)
- J.U.C体系结构(java.util.concurrent)
- HTML网页基本标签:
- Cg入门1:输入输出和语义
- DB2数据库创建非实例用户连接使用数据库