Latest versionsfixlist
11.1.0.6 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26
Question in the chat LiveZilla Live Help

DB2 - Problem description

Problem IC77874 Status: Closed

INCORRECT EXPORTED DATA LENGTH FOR THE EXPORT COMMAND SPECIFYING MODIFIED
BY CODEPAGE=954

product:
DB2 FOR LUW / DB2FORLUW / 950 - DB2
Problem description:
The exported data length may be incorrect when "MODIFIED BY 
codepage=954" is specified to the export command. 
 
Note that the issue may happen when the system codepage is UTF-8 
for Japanese language (ex. JA_JP.UTF-8 for AIX) but it does not 
happen for Ja_JP (SJIS) or ja_JP (EUC JP). 
 
The following is an example of reproduction scenarios on AIX. 
Though the correct data length should be 15 bytes, the exported 
data is expanded with trailing x'20' characters. 
 
$ export LANG=JA_JP.UTF-8 
$ db2start 
07/12/2011 16:23:36     0   0   SQL1063N  DB2START processing 
was successful. 
SQL1063N  DB2START processing was successful. 
$ db2 CREATE DB test USING CODESET EUC-JP TERRITORY JP 
DB20000I  The CREATE DATABASE command completed successfully. 
$ db2 connect to test 
 
   Database Connection Information 
 
 Database server        = DB2/AIX64 9.7.3 
 SQL authorization ID   = E97Q3AF 
 Local database alias   = TEST 
 
$ db2 "create table test (ip char(15) not null default 
'127.0.0.1')" 
DB20000I  The SQL command completed successfully. 
$ db2 "insert into test values ('1.1.1.1')" 
DB20000I  The SQL command completed successfully. 
$ db2 select ip from test 
 
IP 
--------------- 
1.1.1.1 
 
  1 record(s) selected. 
 
$ db2 select "HEX(ip) from test" 
 
1 
------------------------------ 
312E312E312E312020202020202020 
 
  1 record(s) selected. 
 
$ db2 "EXPORT TO test1.csv OF DEL SELECT * FROM test" 
SQL3104N  The Export utility is beginning to export data to file 
"test1.csv". 
 
SQL3105N  The Export utility has finished exporting "1" rows. 
 
 
Number of rows exported: 1 
 
$ od -x test1.csv 
0000000  2231 2e31 2e31 2e31 2020 2020 2020 2020 
0000020  220a 
 
0000022 
$ db2 "EXPORT TO test2.csv OF DEL MODIFIED BY 
codepage=954 SELECT * FROM test" 
SQL3104N  The Export utility is beginning to export data to file 
"test2.csv". 
 
SQL3105N  The Export utility has finished exporting "1" rows. 
 
 
Number of rows exported: 1 
 
$ od -x test2.csv 
0000000  2231 2e31 2e31 2e31 2020 2020 2020 2020 
0000020  2020 2020 2020 2020 2020 2020 2020 2020 
0000040  2020 2020 2020 2020 2020 2020 2020 220a 
 
0000060
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* export command user                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to V9.5 Fix Pack 9.                                  * 
****************************************************************
Local Fix:
Use DB2CODEPAGE instead of "MODIFIED BY". 
 
export DB2CODEPAGE=954 
 
It should be done before connecting to the database.
available fix packs:
DB2 Version 9.5 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 10 for Linux, UNIX, and Windows

Solution
Problem was first fixed in Version 9.5 Fix Pack 9.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
02.08.2011
27.03.2012
27.03.2012
Problem solved at the following versions (IBM BugInfos)
9.5.FP9
Problem solved according to the fixlist(s) of the following version(s)
9.5.0.9 FixList
This site uses cookies to make it easier for us to provide you with our services. By using our site you agree to the use of cookies.