oracle计算日期的问题!
写了一个包,包里有一个存储过程
存储过程有一个传入参数和一个游标
功能:根据传入的日期,计算上一个月的日期,然后查询出这两个月之间的全部信息
但是存储过程报错了,各位帮我看看,谢谢
create or replace package body PKG_T_BlogSearchDate
as
procedure PRO_T_BlogSearchDate(bgdate varchar2,mycur_out out mycur)
is
mm_temp date;--上一月
begin
select to_char(add_months(trunc(bgdate),-1),'yyyy-mm') into mm_temp from dual; --根据传入月份,获取上一月份
open mycur_out for
select * from t_blog where bg_date between mm_temp and bgdate order by bg_date desc;
end PRO_T_BlogSearchDate;
end PKG_T_BlogSearchDate;
错误信息:ora-00932不一致的数据类型:要求date得到却是number