Scenario: (DB2 database)
When you connect to the data sample, the message "sql0332n" is not converted from the source code page "1114" to the target code page "unknown. The cause code is "1 ". Sqlstate = 57017
I have encountered this kind of error several times. For the first time, I had no time to find the answer and re-installed the system. It was silly.
Today I met this problem again. there are many reasons for this problem. this sample has been used before, and some contents of the database have not been modified. today, when I suddenly used the database, a program prompts such an error.:
[IBM] [CLI driver] [DB2/NT] sql0332n has not been converted from the source code page "1386" to the target code page "950. The cause code is "3 ". Sqlstate = 57017
So I want to see the content of this database from the client. When I connect to the database using some tools, an error is prompted in the title.
I have seen a lot of solutions to this problem, such:
Db2set db2codepage = 1114
Db2stop force
Db2start
However, there is a problem here. The solution to a related problem provided by IBM is as follows:
For example:
When the command: DB2 connect to db_name is issued, the system returns
Sql0332n there is no available conversion for the source code page "819" to the target code page "1386". Reason code "1". sqlstate = 57017
DB2 requires that the source code page and the target code page be compatible with each other. In the preceding example, if the source code page is 819 and the target code page is 1386 incompatible, the database connection fails. The solution is as follows:
On the machine that fails to issue the DB2 connect command, execute the following command in the DB2 command window and re-Connect:
->
Db2set db2codepage = 1386-I instance_name
DB2 terminate
Here: sql0332n is not converted from the source code page "1114" to the target code page "unknown. The cause code is "1 ". Sqlstate = 57017
The target code page is "unknown". Are you confused?
However, when I run a program that connects to data, the following prompt appears: IBM] [CLI driver] [DB2/NT] sql0332n has not been converted from the source code page "1386" to the target code page "950. The cause code is "3 ". Sqlstate = 57017
Therefore, we use 950 to replace 1386 in db2codepage = 1386.
The solution is as follows:
System: Windows XP
Run db2cmd at Start> run. The DB2 CLP window is displayed.
Enter the command db2set db2codepage = 950 and press Enter.
Enter the DB2 terminate command and press Enter.
Message displayed: The db20000i terminate command is successfully completed.
Enter the command db2stop force and press Enter.
Message displayed: sql1064n db2stop is successfully processed.
Enter command db2start and press ENTER
Message displayed: sql1063n db2start is successfully processed.
Enter the command DB2 connect to sample and press enter/* sample is the name of the database to be connected.
Prompt message:
Database connection information
Database Server = DB2/NT 8.2.4
SQL authorization id = Wuyi
Local Database alias = sample
The database is connected successfully.
If you test the connection through the configuration Assistant in the DB2 control center, no error message is displayed.
As for the reason that the above error occurs without making configuration changes to the database, no check has been conducted.
Come out. After finding the cause, I will study it with you again.