DB2 - Problem description
Problem IC88644 | Status: Closed |
Inconsistent removal of trailing and leading zeros when converting number literals to string in NUMBER datatype mode | |
product: | |
DB2 FOR LUW / DB2FORLUW / A10 - DB2 | |
Problem description: | |
This APAR is only applicable to databases created with NUMBER data type compatibility feature turned on. It contains two parts Part 1: The VARCHAR function applied to a number literal does not remove the trailing zeros. This APAR provides a fix to remove the trailing zeros from the input number literal to be consistent with the CHAR function. For example: CHAR(0123.450) returns 123.45 By applying this fix, VARCHAR(0123.450) will also return 123.45 Part 2: The CAST specification with a number literal as the operand and cast to CHAR, VARCHAR, GRAPHIC, VARGRAPHIC does not conform to the semantic of the equivalent function forms, such as CHAR(123.450), VARCHAR(123.450). With the fix provided by this APAR, all castings using the CAST keyword to CHAR, VARCHAR, GRAPHIC, VARGRAPHIC will return the string representation of the number literal with all the leading and trailing zeros removed. For example, CAST(123.450 as VARCHAR(20)) will return the string "123.45". Note: The database with the NUMBER data type enabled will have the number_compat database configuration parameter set to ON. The NUMBER data type feature is enabled when setting the fifth bit position of the DB2_COMPATIBILITY_VECTOR (0x10) prior to the creation of the database. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description. * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 version 10.0.1.2. * **************************************************************** | |
Local Fix: | |
available fix packs: | |
DB2 Version 10.1 Fix Pack 2 for Linux, UNIX, and Windows | |
Solution | |
Upgrade to DB2 version 10.0.1.2. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 28.11.2012 07.01.2013 07.01.2013 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
10.1.0.2 | |
10.5.0.2 |