用镜头记录,用心灵体验 | 订阅本站 | 所有笔记 | 亲和力设计 | 流量

DB2 学习笔记

博客话题:DB2,Linux,Web,业余无线电,户外,摄影,截拳道,Thankpad,其他

DB2 开发

SQL0332N Reason Code 1

dos> db2 connect to db_name user xxx using ***

SQL0332N 没有从源代码页“819”至目标代码页“1386”的转换,原因码是“1”
SQLSTATE=57017


原因:连接的数据库使用的代码页设置(819)与本地客户端设置的代码页(1386)不同 之间无法进行双向转换,即无法将GBK 编码的字符转换为ISO-8859-1字符,解决方法:

dos> db2set DB2CODEPAGE=819
dos> db2 terminate
dos> db2 connect to db_name user xxx using ***
连接成功。

如果数据库是UTF-8 encoded,本地客户端的代码页是1386,则可以正常连接,不存在此问题。

对于本地的代码页似乎只能设置一个值
,因此如果需要同时连接多个具有不同代码页的数据库,就会比较麻烦,无法做到真正的同时连接,只能每次使用上面的命令切换。

Alex's picture

my email address in picture

搜索|Search

评论|Recent Comments

按月归档|By Month

2009
07
2008
11
10
07
05
04
03
02
01
2007
12
10
07
06
05
04
03
02
01
2006
12
11
10
09
08
07
06
05
04
03
02
01
2005
11
10
09
08
07
04
03
2004
12
11
10
09
08
07
06
05
04
03
02
01
2003
12
10
09
08
06
2002
09
08
04
03
02
2001
12
09
07
06
05

我读|My Books

我的链接|My Links

我的朋友|My Friends

Creative Commons License
This blog is licensed under a Creative Commons License.
Movable Type 4 Logo