Solutions to SQLSTATE 57017

Source: Internet
Author: User
Tags db2 db2 client db2 connect db2 connect to

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.

<

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.