Latest versionsfixlist
11.1.0.7 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

DB2 - Problem description

Problem IT02020 Status: Closed

LPAD() AND RPAD() FUNCTION WITH EMPTY STRING CAUSES THE RESULT STRING TO BE
PADDED WITH '00' CHARACTERS

product:
DB2 FOR LUW / DB2FORLUW / A10 - DB2
Problem description:
Calling LPAD() and RPAD() function with an empty string '' (pad, 
third parameter) results in a output string with right padded 
with '00'`s characters up to the length provided. The resulting 
varchar string is padded with '00' chars which should not 
happen. 
 
Example: 
 
select LPAD('AAAAA', 10, '') AS F1 from sysibm.sysdummy1 
 
F1 
---------- 
AAAAA 
 
  1 record(s) selected. 
 
 
 
select HEX(LPAD('AAAAA', 10, '')) AS F1 from sysibm.sysdummy1 
 
F1 
-------------------- 
41414141410000000000 
 
  1 record(s) selected. 
 
 
If the pattern (third argument of L/RPAD()) is an empty string 
'', then we should return the result without any padding.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* ALL                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Problem Description above.                               * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 Version 10.1 Fix Pack 5.                      * 
****************************************************************
Local Fix:
Solution
First fixed in DB2 Version 10.1 Fix Pack 5.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
26.05.2014
14.07.2015
14.07.2015
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.1.0.5 FixList