DB2 - Problem description
Problem IC63931 | Status: Closed |
FUNCTIONS DAYNAME & MONTHNAME MAY RETURN INCORRECT RESULTS IF IN PUT IS NOT TIMESTAMP AND SYSTEM IS SET_UP WITH NON-EN_US LOCALE | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
The scalar functions DAYNAME and MONTHNAME may be resolved as SYSFUN version instead of SYSIBM version when the expression argument is not a timestamp. The SYSFUN version may return different results because the SYSFUN version does not depend on the CURRENT LOCALE LC_TIME special register. For example, if the CURRENT LOCALE LC_TIME is a fr_FR locale then the correct output for MONTHNAME('2007-03-09-14.07.38.123456') would be 'mars'. But since the expression is not a timestamp, the en_US value of 'March' is returned in error. If the locale is en_US, then this problem will not occur and the correct results will be returned. The problem only has impact for locales other than en_US. However, please, note that SYSFUN version will not perform as well as the SYSIBM version. This APAR will ensure that SYSIBM version is used and will improve performance for en_US locales as well. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * DB2 LUW v97 * **************************************************************** * PROBLEM DESCRIPTION: * * The scalar functions DAYNAME and MONTHNAME may be resolved * * as * * SYSFUN version instead of SYSIBM version when the expression * * * * argument is not a timestamp. The SYSFUN version may return * * * * different results because the SYSFUN version does not * * * * depend on the CURRENT LOCALE LC_TIME special register. * * * * * * * * For example, if the CURRENT LOCALE LC_TIME is a fr_FR locale * * * * then the correct output for * * * * MONTHNAME('2007-03-09-14.07.38.123456') would be 'mars'. * * But * * since the expression is not a timestamp, the en_US value of * * * * 'March' is returned in error. * * * * * * * * If the locale is en_US, then this problem will not occur and * * the * * correct results will be returned. * * * * The problem only has impact for locales other than en_US. * * * * However, please, note that SYSFUN version will not perform * * as * * well as the SYSIBM version. * * * * This APAR will ensure that SYSIBM version is used and will * * * * improve performance for en_US locales as well. * **************************************************************** * RECOMMENDATION: * * Install DB2 LUW v97 fixpak 1. * **************************************************************** | |
Local Fix: | |
Two possible local fixes are: 1) Qualify the function with SYSIBM, for example SYSIBM.MONTHNAME('2007-03-09-14.07.38.123456') will return 'mars' in a fr_FR locale as expected 2) Specify the expression with type as timestamp, for example MONTHNAME(timestamp '2007-03-09-14.07.38.123456') will return 'mars' in a fr_FR locale as expected | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 1 for Linux, UNIX, and Windows | |
Solution | |
Install DB2 LUW v97 fixpak 1. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 21.10.2009 17.02.2010 17.02.2010 |
Problem solved at the following versions (IBM BugInfos) | |
9.7. | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.1 |