1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| create or replace function f_get_after_day(v_kssj date, v_delay number) return date is v_real_kssj date := v_kssj; v_real_jssj date; v_kssj_jjr number := 0; v_jssj_jjr number := 0; v_days_jjr number := 0; begin
select count(1) into v_kssj_jjr from sys_holiday where to_date(holiday, 'yyyy/mm/dd') = trunc(v_real_kssj); if v_kssj_jjr != 0 then v_real_kssj := trunc(v_real_kssj + 1); end if; v_real_jssj := v_real_kssj + v_delay; select count(1) into v_jssj_jjr from sys_holiday where to_date(holiday, 'yyyy/mm/dd') = trunc(v_real_jssj); if v_jssj_jjr != 0 then v_real_jssj := v_real_jssj + 1; select count(1) - 1 into v_days_jjr from sys_holiday where to_date(holiday, 'yyyy-mm-dd hh24:mi:ss') >= v_real_kssj and to_date(holiday, 'yyyy-mm-dd hh24:mi:ss') < v_real_jssj; else select count(1) into v_days_jjr from sys_holiday where to_date(holiday, 'yyyy-mm-dd hh24:mi:ss') >= v_real_kssj and to_date(holiday, 'yyyy-mm-dd hh24:mi:ss') < v_real_jssj; end if;
if v_days_jjr !=0 then v_real_jssj := f_get_after_day(v_real_jssj,v_days_jjr); end if;
return v_real_jssj; end f_get_after_day;
|