Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AIX NLS

Status
Not open for further replies.

superstarjpmc

Programmer
Jan 22, 2004
38
US
After I change all locales to pt_PT except LC_NUMERIC, which is set to en_US, decimal value returned by db2 query is with “comma” as the decimal separator instead of “period” (expected behavior is period).


# oslevel -r
5100-05

# locale -a
C
POSIX
pt_PT
en_US
en_US.8859-15
en_US.ISO8859-1
en_ZA
pt_PT.8859-15
pt_PT.8859-15@euro
pt_PT.IBM-1252
pt_PT.IBM-1252@euro
pt_PT.ISO8859-1
en_ZA.8859-15

# locale
LANG=en_US
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_MESSAGES="en_US"
LC_ALL=

# locale -ck LC_NUMERIC
LC_NUMERIC
decimal_point="."
thousands_sep=","
grouping="3"



# db2 connect to test user db2 using db2
# db2 "insert into dec_test values(23.12)"
# db2 "select * from dec_test"

DEC_FIELD
----------------------
23.120000 ( NOTE: Decimal Separator is Period. Works fine )

# db2 terminate

# export LC_NUMERIC=en_US
# export LANG=pt_PT
# locale
LANG=pt_PT
LC_COLLATE="pt_PT"
LC_CTYPE="pt_PT"
LC_MONETARY="pt_PT"
LC_NUMERIC=en_US
LC_TIME="pt_PT"
LC_MESSAGES="pt_PT"
LC_ALL=

# locale -ck LC_NUMERIC
LC_NUMERIC
decimal_point="."
thousands_sep=","
grouping="3"

# db2 connect to test user db2 using db2
# db2 "select * from dec_test"

DEC_FIELD
----------------------
23,120000
(NOTE: Decimal Separator is COMMA. Expected Separator is period)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top