IBM / nodejs-idb-connector

A JavaScript (Node.js) library for communicating with Db2 for IBM i, with support for queries, procedures, and much more. Uses traditional callback-style syntax
MIT License
37 stars 23 forks source link

Cannot convert between code set (CCSID 819) and code set (CCSID 37) #37

Closed abmusse closed 6 years ago

abmusse commented 6 years ago

Original report by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


Working on a customer's machine today and came across an error I have not seen before.

Anyone know what I can check?

Scenario:

Node REPL:

$ node

>     var db = require('idb-connector');

    var sSql = 'SELECT STATE FROM QIWS.QCUSTCDT';

    var dbconn = new db.dbconn();

    dbconn.conn("*LOCAL");

    var stmt = new db.dbstmt(dbconn);

    stmt.exec(sSql, (x) => {
      console.log("%s", JSON.stringify(x));
      stmt.cloCannot convert between code set  (CCSID 1208) and code set  (CCSID 37)
seCannot convert between code set  (CCSID 819) and code set  (CCSID 37)
ERROR: SQLALLOCENV(-1)();Cannot convert between code set  (CCSID 819) and code set  (CCSID 37)
  undefined
> (node:2850) Warning: N-API is an experimental feature and could change at any time.
    var sSql = 'SELECT STATE FROM QIWS.QCUSTCDT';
undefined
>     var dbconn = new db.dbconn();
Cannot convert between code set  (CCSID 819) and code set  (CCSID 37)
bconn.disconnundefined
>     dbconn.conn("*LOCAL");
undefined
>     var stmt = new db.dbstmt(dbconn);
Error: SQLSTATE=PAERR SQLCODE=8013 The Dbconn Object is not connected
> 
>     stmt.exec(sSql, (x) => {
...       console.log("%s", JSON.stringify(x));
...       stmt.close();
...       dbconn.disconn();
...       dbconn.close();
...     });
abmusse commented 6 years ago

Original comment by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


chroot_setup nls cured the ailment!

abmusse commented 6 years ago

Original comment by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


@ThePrez and @kadler, having the customer try that right now.

@brianmjerome, you QCCSID is set to 65535 most likely. 65535 means "don't perform a translation", more or less. You should set it to a value. Mine is set to 37, for example. More CCSID reading here: http://yips.idevcloud.com/wiki/index.php/IBMi/65535

abmusse commented 6 years ago

Original comment by Brian Jerome (Bitbucket: bjerome, GitHub: brianmjerome).


Just would like to add I'm getting the following error with the example: Character conversion between CCSID 1208 and CCSID 65535 not valid.

Seeing if updating XMLSERVICE helps (not sure)

abmusse commented 6 years ago

Original comment by Jesse G (Bitbucket: ThePrez, GitHub: ThePrez).


chroot_setup nls might help.

Otherwise, suggesting assignment to @dmabupt

abmusse commented 6 years ago

Original comment by Kevin Adler (Bitbucket: kadler, GitHub: kadler).


Are the iconv converters installed under /QOpenSys/usr/lib/nls/loc/iconv in the chroot?