【发布时间】:2016-01-07 06:35:42
【问题描述】:
declare
CURSOR C1 IS
Select to_date(DateRange,'dd-mm-rrrr') DateRange
from (select to_date('01-JAN-2016','DD-MON-RRRR') - 1 + level as DateRange
from DUAL
where (TO_DATE('01-JAN-2016', 'DD-MON-RRRR') - 1 + level) <= LAST_DAY(TO_DATE('31-DEC-2016', 'DD-MON-RRRR'))
connect by level<=366)
where substr(to_char(DateRange,'DAY'),1,3) in ('SUN','SAT');
begin
if not c1%ISopen
then
open C1;
end if;
dbms_output.put_line("Cursor is created and number of affected rows are: " || c1%rowcount);
close c1;
end;
/
即使在创建光标中使用的 select 语句运行良好,但是当我尝试执行代码时,它会抛出错误 -- ORA-01403 - 找不到数据
【问题讨论】: