pl/SQL报错提示:
inconsistent datatypes:expected date got number
下面是PL/SQL语句:
--and to_char(wsh.last_update_date, 'yyyy-mm-dd')>=:p_begin_date
--and to_char(wsh.last_update_date, 'yyyy-mm-dd')<=:p_end_date
--我把上面的两个时间参数修改成下面的格式以后就显示PL/SQL的错误提示了,但按照上面的格式却没有显示数据也没报错
and wsh.last_update_date between &p_begin_date and &p_end_date
inconsistent datatypes:expected date got number
下面是PL/SQL语句:
--and to_char(wsh.last_update_date, 'yyyy-mm-dd')>=:p_begin_date
--and to_char(wsh.last_update_date, 'yyyy-mm-dd')<=:p_end_date
--我把上面的两个时间参数修改成下面的格式以后就显示PL/SQL的错误提示了,但按照上面的格式却没有显示数据也没报错
and wsh.last_update_date between &p_begin_date and &p_end_date
解决方案 »
- ORA-00059: 超出 DB_FILES 的最大值?
- 求助,怎样优化sql语句以便更快速的查出结果?
- trigger能批量生成吗
- ORA-12541:TNS:没有监听器
- 请问Oracle 是不是把它管理的数据空间全部或分为 "表空间"这个东西? 新建用户的时候都要指定表空间
- 问几个很简单的问题,希望大家帮我。一个非技术类,一个基础类。
- 请问,我在登录的时候,出现"shared memory realm does not exit"?
- 请问:我想只取第100到300条的纪录,应该怎么做呢?
- 有没有Oracle for Solaris(x86)??
- 请教负载均衡、安全性高的部署方案
- 在线等 写条update语句,正确立即结贴
- ORA-01652: 无法通过 16 (在表空间 TB1 中) 扩展 temp 段
and trunc(wsh.last_update_date) between nvl(&p_begin_date,to_date(wsh.last_update_date)) and nvl(&p_end_date,to_date(wsh.last_update_date))
to_date(wsh.last_update_date,'yyyy-MM-dd') between &p_begin_date and &p_end_date
你要求输入的是字符型,因此加上单引号,
and wsh.last_update_date between '&p_begin_date' and '&p_end_date'
以上,请试一下
to_date里面搞错了
and trunc(wsh.last_update_date) between nvl(&p_begin_date,to_date(&p_begin_date, 'yyyy-mm-dd')) and nvl(&p_end_date,to_date(&p_end_date, 'yyyy-mm-dd'))
pl/SQL报错提示:
inconsistent datatypes:expected date got number