db2 import 文件到数据库中发现中文乱码,导出时没有做其他设置,应该是导出服务器和导入服务器之间的codepage差异,导入时指定codepage就可以了
db2 import from filename.del of del modified by codepage=1208 commitcount 100000 replace into table_name;
codepage=1208代表的是utf-8编码
codepage=1386代表的是GBK编码
其中utf-8编码下,汉字的字节长度为2.
即 select length(‘啊’) from sysibm.dual 结果为2