Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    67

    Unanswered: MONTHNAME(date) gives month's name in English instead of Spanish

    DB2 9.7 FP 6
    Windows Server 2008 R2


    We recently changed from DB2 9.1 to 9.7. On DB2 9.1 the command
    SELECT MONTHNAME(CURRENT DATE) FROM SYSIBM.SYSDUMMY1
    gave the name of the month in Spanish. After the upgrade it changed to English.

    We made a offline backup on 9.1 and a restore on 9.7. The configuration of the database hasn't changed.

    Actual configuration of the database:
    Database territory = Lat
    Database code page = 1252
    Database code set = IBM-1252
    Database country/region code = 3

    I found that
    SELECT MONTHNAME(CURRENT DATE, 'CLDR 1.5:es_ES') FROM SYSIBM.SYSDUMMY1
    gives the name of the month in Spanish.

    Is there an easier way?


    Thanks in advance.

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Looking in Information Center,
    those may be worth to try

    (1) Set CURRENT LOCALE LC_TIME, like...
    SET CURRENT LOCALE LC_TIME = 'CLDR 1.5:es_ES'

    OR
    (2) Use SUSFUN.MONTHNAME, like...
    SELECT SUSFUN.MONTHNAME(CURRENT DATE) FROM SYSIBM.SYSDUMMY1


    SET CURRENT LOCALE LC_TIME - IBM DB2 9.7 for Linux, UNIX, and Windows

    CURRENT LOCALE LC_TIME - IBM DB2 9.7 for Linux, UNIX, and Windows

    SET CURRENT LOCALE LC_TIME - IBM DB2 9.7 for Linux, UNIX, and Windows

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •