A problem was found when using remote federated database objects: 1. Connect to remote database query data
Select Jybs_mx From Mq_agntinfo Fetch 1 Rows only with ur; |
Results
2, connect the local database, through the Remote Federated database object query the same table
It turned out to be
Compared with the remote database, one Chinese character is missing. 3, through the following SQL statements
Select Jybs_mx,length (Trim (JYBS_MX)) From Mq_agntinfo Fetch 1 Rows only with ur; |
Connection remote database query results are:
JYBS_MX 2 0 Member Downgrade 9 |
The result of connecting to a local database query is:
JYBS_MX 2 0 members down 10 |
The local database processed 1 Chinese characters as 3 bytes, while the remote database processed 1 Chinese characters as 2 bytes, while the field JYBS_MX data type is varchar (10) and more than half was truncated. 4. View the character set of remote database and local database, respectively The original character set of the remote database is "GBK", and the local database's character set is "UTF-8" Conclusion: When DB2 database character set is UTF-8, 1 Chinese characters account for 3 bytes 5, the simple solution: The local nickname corresponding to the field type length, the problem is resolved. |