oracle 数字或值错误 : 字符到数值的转换错误

oracle 数字或值错误 : 字符到数值的转换错误declare
cursor cur is select a.empno,a.sal,a.hiredate from emp a,emp b
where a.mgr = b.empno;
cc cur%rowtype;
begin
for cc in cur
loop
if (to_date(to_char(cc.hiredate,'yyyy-mm'),'yyyy-mm') - to_date(to_char('1981-06','yyyy-mm'),'yyyy-mm'))<30
then update emp set sal= sal*1.1 where empno = cc.empno;
else

update emp set sal = sal * 1.05 where empno = cc.empno;
end if;
end loop;
end;

另外
两个to_date 相减,返回的是天数吧,,如果我想查询哪些人是在1981年6月工作的,是让两个to_date相减=0还是<30(假设一个月30天)呢??

非常感谢您抽出时间帮我解答问题

open cur

fetch cur into cc.empno,cc.sal,cc.hiredate
当然你这样写cur里是没有值的,类型当然也不对,你试试把这2个加进去。
温馨提示:答案为网友推荐,仅供参考