Incorrect Characters Returned Using DG4DRDA Against DB2 With Korean Characterset (Doc ID 1306203.1)

Last updated on JANUARY 18, 2017

Applies to:

Oracle Database Gateway for DRDA - Version 11.2.0.1 to 11.2.0.2 [Release 11.2]
Information in this document applies to any platform.

Symptoms

With the following setup -

DG4DRDA 11.2.0.1 on Sun Solaris 10 - HS_LANGUAGE KO16DBCS
RDBMS 10.2.0.4 on Windows - NLS_CHARACTERSET KO16MSWIN949
IBM zOS 1.10 with IBM DB2 for ZOS Ver 9.0 - CCSID 13121

A select of data from a DB2 table returns incorrect characters to Oracle using the Database Gateway for DRDA 11.2. A gateway debug trace shows a problem with the native ODBC driver used by the gateway.

DB2:
====
Create on the DB2 database with CCSID 13121 a table:

create table cau000a.test98
(var1 varchar2(50));

and insert a record:
insert into cau000a.test98 values ('A');

The select dumping the character inserted into the DB2 database shows:
SELECT HEX(VAR1) FROM CAU000A.TEST98;

---------+---------+---------+---------+---------+---------+---------+--------
C1

which is correct according to the IBM documentation.

Oracle:
=======
In gateway init<sid>.ora set -
HS_LANGUAGE=AMERICAN_AMERICA.KO16DBCS

Using the DRDA 11.2 gateway fails to display the characters and the dump in
SQL*Plus:

DUMP(VAR1,16)
------------------------------------------------------------------------------
Typ=1 Len=2: a1,e0

matches the dump in the gateway trace and shows for the character A:

SQLFetch: row: 1, column 1, bflsz: 20, bflar: 32
SQLFetch: row: 1, column 1, bflsz: 20, bflar: 32, (bfl: 19, mbl: 19)
00: A1E0A1E0 A1E07EA1 E0A1E040 A1E0A1E0 [......~....@....]
10: A1E07E00 A1E0A1E0 A1E07EA1 E0A1E040 [..~.......~....@]


The gateway trace contains also some more additional information:

hgopoer, line 233: got native error 0 and sqlstate 01004; message follows...
[Oracle][ODBC DB2 Wire Protocol driver]String data, right truncated. Error in
column 1. {01004}[Oracle][ODBC DB2 Wire Protocol driver]String data, right
truncated. Error in column 1. {01004}
Exiting hgopoer, rc=0 at 2010/05/04-11:19:41

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms