FUNCTIONS DAYNAME() AND MONTHNAME() RETURN RESULTS IN ENGLISH ONLY

Technote (FAQ)


Question


Starting DB2 Version 9.7, DB2 has provided mothnname under schema SYSIBM and SYSFUN. Since the default value of current path special register is "SYSIBM","SYSFUN","SYSPROC","SYSIBMADM", sysibm function are invoked for default current path. The sysibm.MONTHNAME function returns a character string containing the name of the month (for example, January) for the month portion of expression, based on value of the special register CURRENT LOCALE LC_TIME.". The initial or default value of CURRENT LOCALE LC_TIME is "en_US" for English (United States). Which mean sysibm.monthname returns dayname/monthname in English.

Application can specify the desired value of CURRENT LOCALE LC_TIME to get the value of monthname/dayname in the desired locale or change the current path value to invoke sysfun function.

If you do not want to modify application, DB2 added new funcationality to customize an application environment using the connect procedureon server. Here is the link
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.dbobj.doc/doc/c0057372.html


Monthname saclar function:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.sql.ref.doc/doc/r0000831.html

MONTHNAME scalar function

>>-MONTHNAME--(--expression--+----------------+--)-------------><
'-,--locale-name-'

This is 'working as per design'. You can update the application env or use connect_proc to change the desired value of special registers.

NOTE : In DB2 version 9.5 MONTHNAME scalar function exist under schema SYSFUN.
This issue was addressed through APAR IZ57412, first fixed in version 9.5 FixPak 5.
Bottomline is there is behaviour change starting from DB2 version 9.7 for this issue.

Answer

Rate this page:

(0 users)Average rating

Document information


More support for:

DB2 for Linux, UNIX and Windows

Software version:

9.7, 9.8, 10.1, 10.5

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1642247

Modified date:

2013-06-27

Translate my page

Machine Translation

Content navigation