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

feat: Set SQL_ATTR_NON_HEXCCSID by default #136

Merged
merged 2 commits into from
Dec 20, 2021

Conversation

abmusse
Copy link
Member

@abmusse abmusse commented Feb 5, 2021

Resolves #135

// the the job CCSID is 65535. The default job CCSID is guaranteed to be a
// non-65535 CCSID. This would help us avoid the common error:
// "Character conversion between CCSID 1208 and CCSID 65535 not valid"
sqlReturnCode = SQLSetEnvAttr(envh, SQL_ATTR_NON_HEXCCSID, &param, 0);
Copy link
Member Author

@abmusse abmusse Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into issue compiling error stating SQL_ATTR_NON_HEXCCSID' was not declared in this scope.

make: Entering directory '~/nodejs-idb-connector/build'
  CXX(target) Release/obj.target/db2ia/src/db2ia/db2ia.o
../src/db2ia/db2ia.cc: In function 'Napi::Object InitAll(Napi::Env, Napi::Object)':
../src/db2ia/db2ia.cc:56:39: error: 'SQL_ATTR_NON_HEXCCSID' was not declared in this scope
   sqlReturnCode = SQLSetEnvAttr(envh, SQL_ATTR_NON_HEXCCSID, &param, 0);
                                       ^~~~~~~~~~~~~~~~~~~~~

I searched /usr/include/sqlcli.h and sure enough it was not defined in that file.

@kadler Is SQL_ATTR_NON_HEXCCSID defined somewhere else?

Copy link
Member Author

@abmusse abmusse Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed with python ibm_db connector there is a check for it:

#ifndef SQL_ATTR_NON_HEXCCSID
#define SQL_ATTR_NON_HEXCCSID 10203
#endif

I just find it weird that its documented here but not defined in the header file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the header file missed getting updated or it is only in a newer IBM i release.

@abmusse abmusse marked this pull request as ready for review August 31, 2021 02:14
@dmabupt dmabupt merged commit 00d33e4 into master Dec 20, 2021
@dmabupt dmabupt deleted the set-SQL_ATTR_NON_HEXCCSID-env-var branch December 20, 2021 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set SQL_ATTR_NON_HEXCCSID CLI environment attribute by default
3 participants