ORA-01843: 无效的月份,解决办法

ORA-01843: 无效的月份,解决方法!
点击右边红色标题查看本文完整版:ORA-01843: 无效的月份,解决方法!

RT

------解决方法--------------------
控制面板--区域

可能是时间格式不一样

*****************************************************************************
欢迎使用CSDN论坛阅读器 : CSDN Reader(附全部源代码)
http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
------解决方法--------------------
如果你 本地和 网络上 插入的 数据完全一样
那么可能是 时间格式 设置问题
------解决方法--------------------
今天出现了ORA-01843的错误.这个错误代表无效的月份一般在日期转化的时候会提示。
解决方法
alter session set NLS_DATE_FORMAT= 'DD-MON-YY ';

可是今天我这样做还是不管用。实际上问题出在这里:

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
O:\> sqlplus greatfinish/finish
SQL*Plus: Release 9.2.0.1.0 - Production on 星期三 6月 21 19:18:00 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
greatfinish@ORA920> select to_date( 'JAN 01 1988 ', 'MON DD YYYY ') from dual;
select to_date( 'JAN 01 1988 ', 'MON DD YYYY ') from dual
*
ERROR 位于第 1 行:
ORA-01843: 无效的月份

greatfinish@ORA920> alter session set NLS_DATE_FORMAT= 'MON DD YYYY ';
会话已更改。
--修改了NLS_DATE_FORMAT问题依然存在
greatfinish@ORA920> select to_date( 'JAN 01 1988 ', 'MON DD YYYY ') from dual;
select to_date( 'JAN 01 1988 ', 'MON DD YYYY ') from dual
*
ERROR 位于第 1 行:
ORA-01843: 无效的月份
--查了一下sysdate发现原因了是客户端字符集问题
greatfinish@ORA920> select sysdate from dual;
SYSDATE
------------
6月 21 2006
greatfinish@ORA920> exit
从Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production中断开
O:\> set NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
O:\> sqlplus greatfinish/finish
SQL*Plus: Release 9.2.0.1.0 - Production on Wed Jun 21 19:20:22 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
--修改完毕成功select
greatfinish@ORA920> select to_date( 'JAN 01 1988 ', 'MON DD YYYY ') from dual;
TO_DATE( '