CLI Connection Errors in IBM DB2 v9.5

Asked 2 years ago, Updated 2 years ago, 108 views

As stated in the title, I would like to connect to DB2(v9.5) from PHP 5.6, but an error occurred and I cannot connect.

Error Contents

 [IBM] [CLI Driver] SQL0332N Character conversion from the source code page "819" to the target code page "UNKNOWN" is not supported.SQLSTATE=57017SQLCODE=-332

Connected From Information

  • Linux Centos 6.7
  • PHP 5.6
  • ibm_db2 1.9.7

Connecting Information

  • Windows Server 2003 R2
  • IBM DB2 v9.5

The code set of the target DB is IBM-943, and I was able to access other DBs that were built with Unicode, so I think it's okay with the source environment.

I thought it would work if I could set the UNKNOWN part of the error, but when I set DB2 CODEPAGE in the Windows environment variable and hit the following command, the display didn't change.

 db2set DB2CODEPAGE=943

If you know how to solve this problem, please cooperate.

php database

2022-09-30 21:02

1 Answers

Self-resolved.

The problem was that the environment variables were not included when running PHP, so I was able to connect successfully by adding DB2CODEPAGE=943 to /etc/sysconfig/httpd.

Thank you for your cooperation.


2022-09-30 21:02

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.