Need help for DB2 codepage

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Need help for DB2 codepage

akiraxt
 
Hello,
 
We are using ODBC/DB2 CLI method to access DB2 LUW. The codeset of DB2 database server is GBK, which is a double bytes charactorset and our application is using UTF-8. When we insert a Chinese string into DB2 table, we may  encount error "[IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001 ".
 
A single Chinese charactor occupies two bytes in GBK codeset, and three bytes in UTF-8 codeset. I think this may be the root cause of data length may overflow during inserting.
 
My question is if there is any configuration parameter or key word in UnixODBC to ensure the CCSID conversion  for DB2 environment ?
 

Vincent Huang

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help for DB2 codepage

Nick Gorham-2
On 28/04/15 08:12, [hidden email] wrote:
 
Hello,
 
We are using ODBC/DB2 CLI method to access DB2 LUW. The codeset of DB2 database server is GBK, which is a double bytes charactorset and our application is using UTF-8. When we insert a Chinese string into DB2 table, we may  encount error "[IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001 ".
 
A single Chinese charactor occupies two bytes in GBK codeset, and three bytes in UTF-8 codeset. I think this may be the root cause of data length may overflow during inserting.
 
My question is if there is any configuration parameter or key word in UnixODBC to ensure the CCSID conversion  for DB2 environment ?
 

Vincent Huang
HI, I dont think unixODBC is directly involved in this, I think you need to configure the code set in the driver/database

--
Nick

_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Loading...