How to read Arabic text from DB2 on z/OS using Node.JS - node.js

I am trying to get data from DB2 table on z/OS in my Node application, where some of the values are stored in Arabic (IBM-420). The result that I am getting in application is the following:
������� ���� ���������
I am using ibm_db version 2.7.4 to fetch data from DB2 and:
Windows 10 - 64 bit
Node version: 14.17.3
NPM version: 7.19.1
I have tried to display the result on the console and writing it on a txt file using fs through following:
fs.writeFile('data.txt', content, err => {
if (err) {
console.error(err)
return
}
})
Any suggestion to convert the text into a proper Arabic?

Resolved by creating the system environment variable DB2CODEPAGE and setting its value to 1208 , then restarting all components to pick up this new variable.
When converting / translating between codepages , the Db2 CLI component will need to know the application code page, along with the DB2 server database code page and convert/translate between them as necessary. This requires the relevant conversion tables to be already present in the Db2 client (in this case the CLIDRIVER).
The DB2CODEPAGE environment variable value 1208 on Microsoft Windows forces the CLI components of Db2 to use Unicode as the application code page. When that DB2CODEPAGE variable is not present then the Db2 CLI component will try to derive the code page from the Microsoft Windows Control Panel Regional Options - which may not be what you need. Other values of this variable are possible, refer to the documentation for details.
When you set DB2CODEPAGE=1208 you must ensure that all the Microsoft -Windows applications really do use unicode or UTF-8 when inserting/updating data in the Db2 tables.

Related

Pentaho: Binary file (standard input) matches

When I'm trying to use MySQL in Table input with an order by in the query, I'm getting below error and ETL stops abruptly.
Binary file (standard input) matches
If I remove order by in the query, it works. Is this a bug in Pentaho?
And, it occurs only in Linux Environment
I'm using Pentaho 8.1.0.0 CE
OS: Ubuntu 16.04.4 LTS
MySQL Driver version: mysql-connector-java-5.1.46.jar
Checks whether the select is returning a zero date 0000-00-00 00:00:00
If so, add the property zeroDateTimeBehavior=convertToNull in the JDBC parameters
This happened to me also in Ubuntu 16.04 and PDI 8.1 (although it worked fine in Windows 10 and PDI 8.1)
In my case happened by a step that had an accent in the name.
Try to keep the names of the steps simple, without accents or any other fancy characters.

Cassandra database import issue for timeuuid

I have installed Cassandra 2.2.12 on my window machine locally. I have exported database from live server in a '.sql' file using 'razorsql' GUI tool. I don't have server access for live, only have database access. When i am trying ti import '.sql' file using 'razorsql' to local cassandra setup, its giving me error (Invalid STRING constant '8ca25030-89ab-11e7-addb-70a0656e5127' for "id" of type timeuuid).
Even i tried using COPY FROM command, its returning same error. Please find attached screen-shot for more detail of error.
Could anybody please help?
You should not put any quotes, because then it gets interpreted as a string instead of UUID - hence the error message.
See also: Inserting a hard-coded UUID via CQLsh (Cassandra)
I think you have two solutions:
edit your export file and remove the single quotes from the inserts.
rerun the export and export the data as csv and run the copy command in cqlsh. In this case, the csv file will not have quotes.

MemSQL support for MySQL style user variables in the load data command

Does MemSQL support user variables in the load data command, similar to MySQL (see MySQL load NULL values from CSV data for examples)? The MemSQL documentation (https://docs.memsql.com/docs/load-data) doesn't give a clue, and my attempts at using user variables have failed.
No, variables in LOAD DATA are not currently supported in general (as of MemSQL 5.5). This is a feature we are tracking for a future release.
We only support the following syntax to skip the contents of a column in the file using a dummy variable (briefly mentioned in the docs https://docs.memsql.com/docs/load-data):
load data infile 'foo.tsv' into table foo (bar, #, #, baz);

Oracle Data Integrator Oracle to Excel encoding

I try to export my Oracle view data to Excel sheet using Oracle Data Integrator.
English text is exported good, but russian (cyrillic) is wrong!
Help me please, how can I configure datasources and encoding.
After export to excel data has cp1252 encoding, but there is no place where such encoding is configured!
Information:
Oracle DS use jdbc:oracle:thin and
NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251
(in windows registry and environment variables(same to database).
ODI starting with product.conf:
AddVMOption -Dfile.encoding=Cp1251
AddVMOption -Dsun.jnu.encoding=Cp1251
AddVMOption -Duser.language=ru
AddVMOption -Duser.country=RU
(and I see such values in Help-About-Properties.
Excel DS use jdbc:odbc and
charSet=cp1251
property.
Oracle 12c, ODI 12c.
If I execute simple java code with
-Dfile.encoding=Cp1251
option - russian language displays correct, but not over ODI...
I would be glad any advice!
I want to answer my own question.
May be it is obviously for anyone, but I found solution not fast...
I need to change Windows property Current language for non-unicode programs. from English to Russian.
So I even not need "AddVMOption -Dfile.encoding=Cp1251" options in ODI - they are set correct after changing property.
Hope this information to be helpful for someone.

node-oracledb other language encoding

I'm newbie at node.js!
I'm in trouble at encoding 'Korean'.
My oracle database has Korean String data, and directly Console.log(Korean text) is worked.
but when I use execute function and select query, and Console.log(return rows), It isn't work. text is broken.
I set all encoding type in Eclipse as UTF-8. As I think, I have to set something controlling encoding type in oracledb module, But I can`t find how set it.
please help me. I have to resolve this problem at any cost!!!
I already set NLS_LANG.
I don't set it. I just check it and take picture. It is already done when I found registry.
Windows 7 64bit
node 0.10.38
Eclipse / NodeClipse
It's resloved.
I set my NLS_LANG variable, as 'original value'.UTF8 And It works.
This is from master of node-oracledb. thanks.
From version 1.0, node-oracledb always sets the "client" character encoding to Oracle's AL32UTF8 value. See https://github.com/oracle/node-oracledb/blob/master/CHANGELOG.md

Resources