ORA-01846:not a valid day of the week .

来源:互联网 发布:mac 开发者必备软件 编辑:程序博客网 时间:2024/05/29 07:17

转载于:http://blog.csdn.net/dreamingcoder259/article/details/6091737

 

 

执行语句

  select next_day('2010-12-11', 'TUESDAY') from dual

报错 ORA-01846:not a valid day of the week 

解决办法: 

alter session set nls_date_language = 'American'

 

alter session 只对当前会话生效;
alter system ......scope=spfile 修改spfile,重启后生效;
alter system ......scope=memory修改当前的实例,不修改spfile,重启后失效;
alter system ......scope=both(默认) 当前实例生效且修改spfile。

 

 

 

 

nls_date_language , SERVER端的日期类型的lang,比如中文的时候,显示“星期一”,英文时,显示MONDAY。 官方解释: NLS_DATE_LANGUAGE specifies the language to use for the spelling of day and month names
and date abbreviations (a.m., p.m., AD, BC) returned by the TO_DATE and TO_CHAR functions. NLS_LANGUAGE specifies the default language of the database. This language is used for messages,
day and month names, symbols for AD, BC, a.m., and p.m., and the default sorting mechanism.
This parameter also determines the default values of the parameters NLS_DATE_LANGUAGE and NLS_SORT.
原创粉丝点击