免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 9424 | 回复: 3
打印 上一主题 下一主题

[SQL0330] Character conversion cannot be performed. [复制链接]

论坛徽章:
4
天蝎座
日期:2013-11-06 11:39:34巳蛇
日期:2014-01-16 16:53:14午马
日期:2014-08-25 21:42:302015年迎新春徽章
日期:2015-03-03 17:21:44
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-06-14 11:18 |只看该作者 |倒序浏览
用jboss做中间层,数据端端maker,MODIFIER的 CCSID均为1388,在中间层新增数据时,一切正常,但在保存数据时出现以下错误,请问是什么原因?

[SQL0330] Character conversion cannot be performed. Cause . . . . . :   An attempt was made to convert column or host variable *N to column or host variable MODIFIER.  The conversion cannot be performed. If the source data is character and has a mixed Coded Character Set Identifier (CCSID), then double-byte characters were found.  These mixed data conversions are only allowed if the source data does not contain any double-byte data.  If the data is graphic, the CCSID values are not compatible or the string contains single-byte characters. The source CCSID is 937, and the target CCSID is 1388. Recovery  . . . :   Ensure that all character or graphic comparison, concatenation, or assignment is between columns or host variables with compatible CCSID values.  If character data and the source CCSID is mixed, the source data should not contain any double-byte characters. If graphic data, the string cannot contain single-byte characters. Use a casting function like VARCHAR to convert between character, DBCS graphic, and Unicode graphic data.

新增数据的字符集为GBK,通过测试发现,把CCSID改为937,系统会保存成功,但会丢失部分中文

有人给指导一下吗?

论坛徽章:
0
2 [报告]
发表于 2014-06-14 16:34 |只看该作者
先把表中原有的数据备份了,再用ALTER TABLE ALTER FIELD 将937的字段改成935或1388,然后将数据恢复回去

论坛徽章:
4
天蝎座
日期:2013-11-06 11:39:34巳蛇
日期:2014-01-16 16:53:14午马
日期:2014-08-25 21:42:302015年迎新春徽章
日期:2015-03-03 17:21:44
3 [报告]
发表于 2014-06-16 10:21 |只看该作者
本帖最后由 lvxinzhi 于 2014-06-17 16:48 编辑

回复 2# mxpy


The source CCSID is 937, and the target CCSID is 1388

这句话说的是数据库中的字符集是1388,
现在要更新的sql 语句里的数据CCSID字符集是937,
在java程序里,并没有指定字符集,后台数据库表中的字段也没有937
这个937是那里来的?

   

论坛徽章:
4
天蝎座
日期:2013-11-06 11:39:34巳蛇
日期:2014-01-16 16:53:14午马
日期:2014-08-25 21:42:302015年迎新春徽章
日期:2015-03-03 17:21:44
4 [报告]
发表于 2014-06-18 08:30 |只看该作者
本帖最后由 lvxinzhi 于 2014-06-18 08:43 编辑

问题已经解决
参考:http://blog.chinaunix.net/uid-200142-id-4308738.html


Server property Description Required ChoicesDefault
package ccsid Specifies the character encoding to use for the SQL package and any statements sent to the server. "1200" (UCS-2)
    "13488" (UTF-16)
no13488


您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP