- edited description
Any CCSID other than 1208 fails to connect to database
I can connect just fine to the database with CCSID 1208 but can't insert data due to character set mismatch.
I set the CCSID via
process.env.DB2CCSID = '273';
but then the idb-connector won't even connect to my database printing out an unreadable error:
Error: SQLSTATE=����� SQLCODE=-950 م���������@ā�������@*LOCAL@�����@��@兙��������@���@������������@ā�������K
at Error (native)
at connectToDb (/home/GUENEY/node/ibm.js:30:8)
at Object.<anonymous> (/home/GUENEY/node/ibm.js:22:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
Comments (8)
-
reporter -
-
assigned issue to
I'm not sure on this one, but assigning to @mengxumx who can probably handle.
-
assigned issue to
-
Account Deactivated Hello Kerim, Would you show me the error when you insert data with CCSID 1208? The system automatically converts character arguments and results between the CCSID of the job or database field and a CCSID used for idb-connector functions that defaults to 1208 (UTF-8). Generally we do not need to change the default CCSID value. But you may try
process.env.DB2CCSID = '0';
-
reporter Hello @mengxumx,
the character set mismatch issue has been resolved (
#18). It wasn't actually a characterset mismatch, despite the error message making it seem so,Nonetheless, shouldn't
process.env.DB2CCSID = '273';
work?
Your suggestion with
process.env.DB2CCSID = '0';
on the other hand does work.
Perhaps I'm confused about what the DB2CCSID environment variable is for. I assumed that it has to match whatever CCSID the database fields are defined in.
-
Account Deactivated Hello @KerimG , the DB2CCSID env var actually calls SQLOverrideCCSID400().
Ref --> https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_61/apis/pase_sqloverrideccsid400.htm
Long long ago this DB2 addon ran with its job CCSID (which corresponding to CCSID = 0). But it had some problems so I overrides the default CCSID to 1208 (UTF-8) and adds this DB2CCSID env var for customization.
-
Account Deactivated @KerimG Can we close this issue now?
-
reporter @mengxumx
I think so, yes. Thank you very much.
-
reporter - changed status to resolved
- Log in to comment