Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with ÅÄÖ Swedish characters #79

Closed
MrTeapot opened this issue Apr 23, 2020 · 25 comments
Closed

Issues with ÅÄÖ Swedish characters #79

MrTeapot opened this issue Apr 23, 2020 · 25 comments
Labels
bug Something isn't working
Milestone

Comments

@MrTeapot
Copy link

MrTeapot commented Apr 23, 2020

Hey!

I'm running node-odbc (2.3.0-beta.0) against IBMI DB2.
All SQL queries have issues with ÅÄÖ being replaced with �.

After reading #46 I figured it has something to do with CCSID; being the root of all evil.
I therefore added CCSID=278 to my connection string, but to no avail.
After adding CCSID I can't connect at all.

        odbc.connect(`Driver=IBM i Access ODBC Driver;System=192.168.1.5;UID=TESTUSER;Password=TESTPASSWORD;CCSID=278`).then(conn => {
            this.databaseConnection = conn;
            console.log('Connected to the database');
        }).catch(err => {
            console.log(err)
        });

Where else can I specify the CCSID to get it to work properly?

The documentations talks about odbc.ini and odbcinst.ini. Do I specify it in those files? But where do I put the files, I currently don't have them anywhere.

Thanks in advance.

@markdirish
Copy link
Contributor

Specifying the CCSID on the connection string should override any CCSIDs in the ~/.odbc.ini or /QOpenSys/etc/odbc.ini, so that shouldn't be a problem. I think the issue might be that the Node.js C/C++ API only has functions for converting to a UTF-8 string and a UTF-16 string.

Try setting the CCSID to 1208 and see if that helps. That should make the driver convert from 278 (what your system/database are problem on) to UTF-8 encoding, so Node.js can convert it correctly.

@MrTeapot
Copy link
Author

Hey!

I tried 1208 with connection string, and also a DSN, but it still doesn't work. DSN=MYDSN;Password=MYPASSWORD;CCSID=1208;

When I have CCSID 278 I get this error;

image

When I use 1208 the Express server crashes with no information. I'll try to debug it.

@kadler
Copy link
Member

kadler commented Apr 23, 2020

The CCSID attribute for the ODBC driver doesn't set the job CCSID, it sets the ODBC's client CCSID. This is understandably confusing as CCSIDs are primarily associated with the IBM i itself and are usually EBCDIC. Even when running on IBM i, the driver and Node.js run in PASE, which is an ASCII environment.

For the ODBC driver, you have to set an ASCII or UTF-8 CCSID (unless somehow you have a strange Windows or Linux that runs EBCDIC 😉). As Mark said, the Node.js interfaces used by node-odbc only supports converting to/from UTF-8, so CCSID should be set to 1208.

@MrTeapot
Copy link
Author

I am now using CCSID=1208 in my connection string.
statement.execute(); seems to crash without letting me catch the error.

This is my code:

        odbc.connect(`DSN=MYSERVER;Password=MYPASSWORD;CCSID=1208;`).then(conn => {
            this.databaseConnection = conn;
            console.log('Connected to the database');
        }).catch(err => {
            console.log(err)
        });
    public async getSession(sessionId: string): Promise<Session> {
        try {
            debugger
            const statement = await this.databaseConnection.createStatement();
            await statement.prepare('SELECT * FROM MYLIB.SESSIONS WHERE session_id = ?');
            await statement.bind([sessionId]);
            const result = await statement.execute();
            return result[0];
        } catch (err) {
            console.log(err);
        }
    };

getSession never reaches the catch statement. statement.execute() crashes the node process it seems.

BTW, my table is CCSID 278.

@kadler
Copy link
Member

kadler commented Apr 23, 2020

@markdirish I wonder if this is related to SQL_NO_TOTAL or other length issues that are being worked on in the 2.3 branch.

@markdirish
Copy link
Contributor

markdirish commented Apr 23, 2020

@MrTeapot can you build with DEBUG in binding.gyp and then run with CCSID 1208 again, pasting the output here? Will help me see what is going on at a deeper level.

binding.gyp:

...
'defines' : [
  'NAPI_EXPERIMENTAL', 'DEBUG'
],
...

Then cd node_modules/odbc && npm install

@markdirish
Copy link
Contributor

@MrTeapot does CCSID 1208 work with odbc@latest, should be version 2.2.3?

@MrTeapot
Copy link
Author

MrTeapot commented Apr 23, 2020

Here it it, it aint pretty:

ODBCConnection::Init
ODBCStatement::Init
[SQLHENV: 0000025DCA94A8E0] ODBC::Connect()
[SQLHENV: 0000025DCA94A8E0] ODBC::ConnectAsyncWorker::Execute()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0] ODBC::ConnectAsyncWorker::Execute(): Calling SQLGetInfo(ConnectionHandle = 0000025DCA94ABE0, InfoType = 30 (SQL_MAX_COLUMN_NAME_LEN), InfoValuePtr = 0000025DCC496640, BufferLength = 2, StringLengthPtr = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0] ODBC::ConnectAsyncWorker::Execute(): SQLGetInfo succeeded: SQLRETURN = 0, InfoValue = 128
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0] ODBC::ConnectAsyncWorker::Execute(): Calling SQLGetInfo(ConnectionHandle = 0000025DCA94A8E0, InfoType = 72 (SQL_TXN_ISOLATION_OPTION), InfoValuePtr = 0000025DCC496644, BufferLength = 4, StringLengthPtr = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0] ODBC::ConnectAsyncWorker::Execute(): SQLGetInfo succeeded: SQLRETURN = 0, InfoValue = 15
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0] ODBC::ConnectAsyncWorker::OnOk()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0] ODBCConnection::CreateStatement()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0] ODBCConnection::CreateStatementAsyncWorker:Execute()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::CreateStatementAsyncWorker::OnOK()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::Prepare()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::PrepareAsyncWorker::Execute()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::PrepareAsyncWorker::Execute(): Running SQLPrepare(StatementHandle = 0000025DCA94CA40, StatementText = SELECT * FROM mylib.sessions WHERE session_id = ?, TextLength = -3)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::PrepareAsyncWorker::Execute(): SQLPrepare succeeded: SQLRETURN = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::PrepareAsyncWorker::Execute(): Running SQLNumParams(StatementHandle = 0000025DCA94CA40, ParameterCountPtr = 0000025DCC424748
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::PrepareAsyncWorker::Execute(): SQLNumParams succeeded: SQLRETURN = 0, ParameterCount = 1
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::PrepareAsyncWorker::OnOk()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::Bind()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::BindAsyncWorker::Execute()
[TODO][SQLHSTMT: 0000025DCA94CA40] ODBC::BindParameters(): Calling SQLBindParameter(StatementHandle = 0000025DCA94CA40, ParameterNumber = 0, InputOutputType = 1, ValueType = -8, ParameterType = 1, ColumnSize = 23, DecimalDigits = 0, ParameterValuePtr = 0000025DCC4AB9B0, BufferLength = 48, StrLen_or_IndPtr = 0000025DCC53D208)
[TODO][SQLHSTMT: 0000025DCA94CA40] ODBC::BindParameters(): SQLBindParameter passed with SQLRETURN = 0, StrLen_or_IndPtr = -3[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::BindAsyncWorker::OnOk()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::Execute()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::ExecuteAsyncWorker::Execute()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::ExecuteAsyncWorker::Execute(): Running SQLExecute(StatementHandle = 0000025DCA94CA40)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::ExecuteAsyncWorker::Execute(): SQLExecute succeeded
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::RetrieveResultSet()
[SQLHENV: 0000025DCA94A8E
2020-04-23T17:34:05: PM2 log: App [my_project:0] exited with code [1] via signal [SIGINT]
0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::RetrieveResultSet(): Running SQLRowCount(StatementHandle = 0000025DCA94CA40, RowCount = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::RetrieveResultSet(): SQLRowCount passed: SQLRETURN = 0, RowCount = -1
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLNumResultCols(StatementHandle = 0000025DCA94CA40, ColumnCount = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLNumResultCols passed: ColumnCount = 27
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 1, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADSTA, NameLength = 5, DataType = 3, ColumnSize = 1, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 1, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 3, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 2, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADCMP, NameLength = 5, DataType = 3, ColumnSize = 2, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 2, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 4, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 3, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADSESS, NameLength = 6, DataType = 1, ColumnSize = 23, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 3, TargetType = 1, TargetValuePtr = 0000025DCC4F7390, BufferLength = 24, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 4, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADUSR, NameLength = 5, DataType = 1, ColumnSize = 60, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 4, TargetType = 1, TargetValuePtr = 0000025DCC4A4F10, BufferLength = 61, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 5, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADHOST, NameLength = 6, DataType = 1, ColumnSize = 50, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 5, TargetType = 1, TargetValuePtr = 0000025DCC403F30, BufferLength = 51, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 6, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADPORT, NameLength = 6, DataType = 1, ColumnSize = 10, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 6, TargetType = 1, TargetValuePtr = 0000025DCC4F70D0, BufferLength = 11, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 7, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADIP, NameLength = 4, DataType = 1, ColumnSize = 15, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 7, TargetType = 1, TargetValuePtr = 0000025DCC4F7210, BufferLength = 16, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 8, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADPGM, NameLength = 5, DataType = 1, ColumnSize = 10, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 8, TargetType = 1, TargetValuePtr = 0000025DCC4F72B0, BufferLength = 11, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 9, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADSERVICE, NameLength = 9, DataType = 1, ColumnSize = 30, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 9, TargetType = 1, TargetValuePtr = 0000025DCC6E5BB0, BufferLength = 31, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 10, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADMETHOD, NameLength = 8, DataType = 1, ColumnSize = 30, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 10, TargetType = 1, TargetValuePtr = 0000025DCC6E5C10, BufferLength = 31, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 11, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADFORMAT, NameLength = 8, DataType = 1, ColumnSize = 10, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 11, TargetType = 1, TargetValuePtr = 0000025DCC4F7150, BufferLength = 11, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 12, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADERRMSGID, NameLength = 10, DataType = 1, ColumnSize = 7, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 12, TargetType = 1, TargetValuePtr = 0000025DCC49C190, BufferLength = 8, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 13, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADERRMSGF, NameLength = 9, DataType = 1, ColumnSize = 10, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 13, TargetType = 1, TargetValuePtr = 0000025DCC4F73B0, BufferLength = 11, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 14, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADERRFLD, NameLength = 8, DataType = 1, ColumnSize = 10, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 14, TargetType = 1, TargetValuePtr = 0000025DCC4F7090, BufferLength = 11, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 15, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADMSG, NameLength = 5, DataType = 1, ColumnSize = 132, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 15, TargetType = 1, TargetValuePtr = 0000025DCC527F70, BufferLength = 133, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 16, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADCPU, NameLength = 5, DataType = 3, ColumnSize = 15, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 16, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 17, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 17, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADIOS, NameLength = 5, DataType = 3, ColumnSize = 15, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 17, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 17, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 18, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADRSP, NameLength = 5, DataType = 3, ColumnSize = 15, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 18, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 17, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 19, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADSIZE, NameLength = 6, DataType = 3, ColumnSize = 15, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 19, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 17, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 20, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADTSMP, NameLength = 6, DataType = 93, ColumnSize = 26, DecimalDigits = 6, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 20, TargetType = 1, TargetValuePtr = 0000025DCC6E5AC0, BufferLength = 27, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 21, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADCDAT, NameLength = 6, DataType = 3, ColumnSize = 8, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 21, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 10, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 22, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADCTIM, NameLength = 6, DataType = 3, ColumnSize = 6, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 22, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 8, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 23, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADJOB, NameLength = 5, DataType = 1, ColumnSize = 10, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 23, TargetType = 1, TargetValuePtr = 0000025DCC4F7170, BufferLength = 11, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 24, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADJOBU, NameLength = 6, DataType = 1, ColumnSize = 10, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 24, TargetType = 1, TargetValuePtr = 0000025DCC4F71B0, BufferLength = 11, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 25, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADJOBN, NameLength = 6, DataType = 3, ColumnSize = 6, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 25, TargetType = 1, TargetValuePtr = 0000000000000000, BufferLength = 8, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 26, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADINP, NameLength = 5, DataType = 12, ColumnSize = 5000, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 26, TargetType = 1, TargetValuePtr = 0000025DCC528240, BufferLength = 5001, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLDescribeCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 27, ColumnName = , BufferLength = 128, NameLength = 0, DataType = 0, ColumnSize = 0, DecimalDigits = 0, Nullable = 0)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLDescribeCol passed: ColumnName = ADOUT, NameLength = 5, DataType = 12, ColumnSize = 25000, DecimalDigits = 0, Nullable = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): Running SQLBindCol(StatementHandle = 0000025DCA94CA40, ColumnNumber = 27, TargetType = 1, TargetValuePtr = 0000025DCC53DBC0, BufferLength = 25001, StrLen_or_Ind = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::BindColumns(): SQLBindCol succeeded: StrLeng_or_IndPtr = 0
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::FetchAll()
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::FetchAll(): Running SQLFetch(StatementHandle = 0000025DCA94CA40) (Running multiple times)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::FetchAll(): SQLFetch succeeded: Stored 6 rows of data, each with 27 columns      
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::FetchAll(): Running SQLCloseCursor(StatementHandle = 0000025DCA94CA40) (Running multiple times)
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCConnection::FetchAll(): SQLCloseCursor succeeded
[SQLHENV: 0000025DCA94A8E0][SQLHDBC: 0000025DCA94ABE0][SQLHSTMT: 0000025DCA94CA40] ODBCStatement::ExecuteAsyncWorker::OnOk()

I also see this in my terminal: [Error: Invalid argument]

@MrTeapot
Copy link
Author

@MrTeapot does CCSID 1208 work with odbc@latest, should be version 2.2.3?

odbc@latest gave me 2.2.2

I have the same issue with that version.

@markdirish
Copy link
Contributor

Aha! Well I have a hunch what the issue is (ignore this technical stuff if you want, its more for me to have something to refresh my memory later):

When converting from C data to a JavaScript string, the package calls:

/// Creates a new String value from a UTF-8 encoded C string with specified length.
static String New(
  napi_env env,      ///< N-API environment
  const char* value, ///< UTF-8 encoded C string (not necessarily null-terminated)
  size_t length      ///< length of the string in bytes
 );

The length is gotten from the value returned in the StrLen_or_IndPtr. In the case of character conversions, it returns SQL_NO_TOTAL, which has a value of -4. So it is trying to build a character string of -4 length, which causes the [Error: Invalid argument], and also explains why your ODBC debug output looks fine.

The fix should be to just NOT pass a size, which will make JavaScript assume that it is a null-terminated string. You could maybe test this yourself by changing this line:

https://github.com/markdirish/node-odbc/blob/78a02d6a5fe715e721e2312bf991ab13f05f789c/src/odbc_connection.cpp#L411

to

value = Napi::String::New(env, (const char*)storedRow[j].char_data);

and see if that fixes it. This function will read the char_data as a null-terminated string, not a string of a given length.

I will try to create a CCSID 278 table on my system and see if I can recreate the error, then see if I can fix it by generating a Napi::String from a null-terminated C string.

@markdirish
Copy link
Contributor

^ My hunch above is right, but you can't just make the change yourself. They are dependent on changes in this PR: #77. Will work on landing all of this soon.

@MrTeapot
Copy link
Author

Great. Thank you! Looking forward to it.

@kadler
Copy link
Member

kadler commented Apr 23, 2020

So it is trying to build a character string of -4 length,

Actually, since the length is a size_t, it gets converted to unsigned, ie. -4 converted to a size_t (on 64-bit) is 0xFFFFFFFFFFFFFFFC or 1.84467440737e+19 (that's 18 exabytes...)

@kadler
Copy link
Member

kadler commented Apr 23, 2020

@MrTeapot as a workaround for now, you can set DEBUG=524288 on the connection string or your DSN. This prevents the IBM i Access ODBC driver from returning SQL_NO_TOTAL.

Note that this will cause a performance reduction as the the total data will have to be converted to calculate the actual length.

On second thought, this might result in errors as #77 also fixes the length calculation when the returned length does not match the available length.

@MrTeapot
Copy link
Author

@kadler Adding DEBUG=524288 stopped the crashing and allows ÅÄÖ. But, it adds a weird character at the end of strings that contain ÅÄÖ:
image

This is the hex value:
C1A7859340D38199A2A296954040404040404040404040404040404040404040404040404040404040404040404040404040

@markdirish
Copy link
Contributor

I have a PR open that should fix all of this. Try to install from my 2.3.0-fetch-copy branch:

npm install markdirish/node-odbc#2.3.0-fetch-copy

Hopefully that branch works, but if not let me know so I can fix it before landing the PR

@kadler
Copy link
Member

kadler commented Apr 24, 2020

Yeah, as I mentioned later I had second thoughts this would work right. The problem is the bug in the node-odbc code that uses the indicator as the returned string length, when actually the indicator contains the length of the string that could be returned. Turning on the debug flag will cause the calculated length to be returned, but when you have expansion going to UTF-8 this could be bigger than the size of the column. So in your example, the column was maybe a CHAR(40) and a 40 byte buffer was bound for it, but the total length was 41, since Å takes 2 bytes in UTF-8. This causes a buffer over-read of random data to be returned in the string.

@MrTeapot
Copy link
Author

I have a PR open that should fix all of this. Try to install from my 2.3.0-fetch-copy branch:

npm install markdirish/node-odbc#2.3.0-fetch-copy

Hopefully that branch works, but if not let me know so I can fix it before landing the PR

It is working! Amazing :D

@markdirish markdirish added the bug Something isn't working label Apr 24, 2020
@markdirish markdirish added this to the 2.3.0 milestone Apr 24, 2020
@nedi-dev
Copy link

The solutions works even for german Umlaute (äöüÄÖÜß)!
You have to install the fixed version:
npm install #2.3.0-fetch-copy
AND set the ccsid of the client to 1208 in the connection string or in the DSN in .odbc.ini.

Do you have an idea when 2.3.0 will be released?

@serininformatica
Copy link

The solution works if i use ODBC but does not work in a loopback project that uses loopback-connector-ibmi ... any suggestion? tx

@markdirish
Copy link
Contributor

Go into node_modules/loopback-connector-ibmi/ and see if it has its OWN node_modules/odbc that is a different version. These changes arent available on npm yet (hoping to release 2.3.0 later this week or next), and so loopback-connector-ibmi uses an older version of odbc

@serininformatica
Copy link

i have changed the version into node_modules/loopback-connector-ibmi/, then ran npm install, but it does not work

@markdirish
Copy link
Contributor

@serininformatica I will continue to look into this. I'm not sure why loopback isn't playing nice with 1208.

@MrTeapot and @nedi-dev would you mind downloading the latest @beta tag from npm and see that everything still seems to work well? I have updated it to include all of these changes.

npm install odbc@beta

@serininformatica
Copy link

I had to remove 2 dev modules to run "npm install" into loopback-connector-ibmi, now it's working

@MrTeapot
Copy link
Author

@serininformatica I will continue to look into this. I'm not sure why loopback isn't playing nice with 1208.

@MrTeapot and @nedi-dev would you mind downloading the latest @beta tag from npm and see that everything still seems to work well? I have updated it to include all of these changes.

npm install odbc@beta

odbc@beta is working! It gives me "odbc": "^2.3.0-beta.1" in package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants