In the project, you need to write the DB2 client program. Both the server and client are AIX. Use the db2 catalog command to add node and db and connect to the database:
Db2 connect to XXX user XXX
SQL0332N There is no available conversion for the source code page "1386"
The target code page "819". Reason Code "1". SQLSTATE = 57017
According to the prompt, the server codepage is 1386, and the client codepage is 819. The conversion cannot be completed. So google, the solution is:
Db2set db2codepage = 819 (it is also said that it is messy to change to 1386)
Db2 terminate
Because this client is still running other DB2 instances, it does not dare to rashly change the codepage, so I have studied how to change it.
According to IBM's official statement (http://publib.boulder.ibm.com/infocenter/db2v7luw/index.jsp? Topic =/com.ibm.db2v7.doc/db2d0/db2d0336.htm ):
The first codepage is the application code page, which is determined when the connection is established. If db2codepage is set, this code is used; otherwise, one is automatically estimated based on the operating system, environment variables, and other elements. IBM recommends the latter method.
The second type of codepage is database code page, which is determined when a database is created.
So how is the application code page estimated when db2codepage is not set?
In UNIX, it is determined based on the locale settings.
In Windows, determine according to the iCountry in the [intl] segment of the win. Ini file.
In 32-bit Windows, confirm according to the registry.
View the link above to see the detailed description. And the specific ing method.
Now, start to solve the problem and modify the user's. profile file so that LANG = zh_CN. Log on again to make it take effect and solve the problem.
In contrast, the solution provided on the Internet, based on the above principle, the client should set db2codepage = 1386.
<