日期:2014-05-17 浏览次数:20973 次
create or replace function ff_isdafu(in_start in date, in_end in date)
return varchar2 is
v_ret varchar2(10) := '二者相等';
v_start date;
v_end date;
i number := 1;
v_flag number := 0;
begin
loop
if v_flag < 3 then
v_start := in_start + i;
if to_char(v_start, 'd') not in ('1', '7') and
to_char(v_start, 'mmdd') not in ('0101', '0501', '1001', '1002', '1003') then
v_end := v_start;
v_flag := v_flag + 1;
end if;
else
exit;
end if;
i := i + 1;
end loop;
if v_end > in_end then
v_ret := 'YES';
elsif v_end < in_end then
v_ret := 'NO';
end if;
return v_ret;
end;