AS400的DB2语法及差异

     AS400 的DB2版本一般可能比较早,一些新版本的特性可能不适用,尤其语法上。

1.语法差异

1.1 语法不支持带“;”号

begin 

insert ...;

end

 

1.2 没有系统表SYSIBM.COLUMNS.

 

1.x 参考文献:

https://www.ibm.com/docs/en/i/7.1?topic=concepts-isolation-level

 

2.隔离级别

db2 change isolation to rs   ---必须是没有连接数据库
db2 set current isolation rs

(如果想执行SQL语句时指定isolation,可以在语句后 + with [cs][rr][rs][ur]

a、可重复读(Repeatable Read,RR)

b、读稳定性(Read Stability,RS)

c、游标稳定性(Cursor Stability,CS)

d、未提交读(Uncommitted Read,UR)

DB2默认的隔离级别为:游标稳定性(CS)

)

 

3.

 

4. odbc 源配置
[DB400]
Driver=/opt/IBM/InformationServer/Server/branded_odbc/lib/VMdb224.so
Description=DataDirect 5.00 DB2 Wire Protocol Driver
AddStringToCreateTable=
AlternateID=
Collection=SCHEMA
DynamicSections=100
GrantAuthid=PUBLIC
GrantExecute=1
IpAddress=bg400.server.ibm.com
IsolationLevel=NO_COMMIT
Location=DB400
LogonID=
Password=
PackageNamePrefix=DD
PackageOwner=
TcpPort=446
WithHold=1

 

10. FAQ

10.1 Q:DB2 SQL7008 -(table) in (file) not valid for the operation ?

A:做日志记录(Journal log),或者去掉自动提交,把自动提交设置为False.
R:

10.2

 

posted @ 2021-06-30 11:43  疾风泣影  阅读(575)  评论(0)    收藏  举报