日期:2014-05-16  浏览次数:20801 次

Oracle 11g 中to_date() 请教
oracle 11g中to_date()的使用:不是格式所要的结果啊???

在sqlplus和SQL Developer中结果是:
SQL> select to_date('11-03-27','yy/mm/dd') day1 from dual;

DAY1
--------------
27-3月 -11
在 PL/SQL Developer 9下的结果是:
SQL> select to_date('11-03-27','yy/mm/dd') day1 from dual;
 
DAY1
-----------
2011/3/27 星
请教原因!!!
Oracle to_date

------解决方案--------------------
引用:
Quote: 引用:

跟你数据库默认的日期显示格式有关。你可以查询NLS_DATE_FORMAT和NLS_DATE_LANGUAGE,select * from V$NLS_PARAMETERS.
SQL> select * from V$nls_Parameters;
 
PARAMETER                                          VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
NLS_LANGUAGE                                   SIMPLIFIED CHINESE
NLS_TERRITORY                                    CHINA
NLS_CURRENCY                                    ¥
NLS_ISO_CURRENCY                            CHINA
NLS_NUMERIC_CHARACTERS            .,
NLS_CALENDAR                                    GREGORIAN
NLS_DATE_FORMAT                            DD-MON-RR
NLS_DATE_LANGUAGE                        SIMPLIFIED CHINESE
NLS_CHARACTERSET                           ZHS16GBK
NLS_SORT                                        &