Oracle日期函数 next_day
在Oracle是提供了next_day求指定日期的下一个日期.
语法 : next_day( date, weekday )
date is used to find the next weekday.
weekday is a day of the week (ie: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY)
可用于:
Oracle 9i, Oracle 10g, Oracle 11g
For example:
next_day('01-Aug-03', 'TUESDAY') would return '05-Aug-03'
next_day('06-Aug-03', 'WEDNESDAY') would return '13-Aug-03'
next_day('06-Aug-03', 'SUNDAY') would return '10-Aug-03'
但是在执行如下命令时出错,错误提示为不合法的 month,但实际上单词本身并没有错,而是环境问题:
SQL> select next_day('01-Aug-03', 'TUESDAY') from dual;
select next_day('01-Aug-03', 'TUESDAY') from dual
*
ERROR at line 1:
ORA-01843: not a valid month
分析问题:
首先查询当前日期语言 NLS_DATE_LANGUAGE 值.
SQL>select * from v$nls_parameters;
PARAMETER VALUE
---------------------------------------------------------------- -----------------------------------
NLS_LANGUAGE SIMPLIFIED CHINESE
NLS_TERRITORY  
相关文档:
SQL中的单记录函数
1.ASCII
返回与指定的字符对应的十进制数;
SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;
A A ZERO &nbs ......
--sqlplus
sqlplus;
sys /password as sysdba;
--查找用户ID(user#),数据库里面存放的用户都是大写!
select user#,name,password from user$ where name ='FACT';
USER# NAME   ......
本实例已完全通过测试,单向,又向同步都可使用.
--名词说明:源——被同步的数据库
目的——要同步到的数据库
前6步必须执行,第6以后是一些辅助信息.
--1、在目的数据库上,创建dblink
drop public database link dblink_orc9 ......
LENGTH calculates length using characters as defined by the input character set.
LENGTHB uses bytes instead of characters.
VSIZE returns the number of bytes in the internal representation of expr.
LENGTHC uses Unicode complete characters.
LENGTH2 uses UCS2 codepoints.
......