數字轉換爲字符的L受哪一個參數影響

咱們知道,若是想把金額帶上本位幣,通常加上L,
好比:
select to_char(salary,'L99,9999.00') from employees;

下面顯示以下:
SALARY TO_CHAR(SALARY,'L99,

2900 ¥2,900.00
2500 ¥2,500.00
4000 ¥4,000.00
3900 ¥3,900.00
3200 ¥3,200.00
2800 ¥2,800.00
3100 ¥3,100.00
3000 ¥3,000.00

windows客戶端通常都沒有問題,但在linux下,其結果爲:

TO_CHAR(SALARY,'L99,9

$2900.00
$2500.00
$4000.00
$3900.00
$3200.00
$2800.00
$3100.00
$3000.00

咱們要設置爲中文的人民幣,只須要在linux下,設置:
nls_lang的區域爲china便可.
export NLS_LANG=_CHINA.zhs16gbk

[oracle@dbserver ~]$ sqlplus /nolog 
SQL*Plus: Release 11.2.0.4.0 Production on Sun May 8 17:50:43 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.

SQL> select to_char(15000,'L99,999.00') from dual;
TO_CHAR(15000,'L99,9

¥15,000.00
SQL> show parameter nls_
NAME TYPE VALUE

nls_currency string ¥
nls_date_language string AMERICAN
nls_dual_currency string ¥
nls_iso_currency string CHINA
nls_language string AMERICAN

nls_sort string BINARY
nls_territory string CHINAlinux

相關文章
相關標籤/搜索