I'm using DB2 CLI to insert data into a db2 database, which is created with codepage 1208(UTF-8). However, DBCLOB and GRAPHIC data cannot be inserted correctly.
After investigating the problem carefully I found that, when CLI tracing is enabled, we can find the Application CODEPAGE is not correct"
Application Codepage=1386, Database Codepage=1208
I know that setting DB2CODEPAGE environment variable using db2set util can deal with this problem and I envoked the db2set command using ShellExecute in my program. However, I found that calling db2set will only take effect the next time my program starts hence my program must restart to reload the environment, which is unacceptable.
So is there a way to set the application CODEPAGE using CLI, or other ways to overcome this problem?