create or replace function fn_get_myjob_interval return date is
Result date;
v_nextdate date;
v_nexthours number;
begin
if to_number(to_char(sysdate, 'dd')) >= 25 then
begin
select max(t.activation_date)
into v_nextdate
from emesp.tp_production_arrange_kt t
where t.activation_flag = 0; /*獲取指派最大的時間*/
exception
when no_data_found then
v_nextdate := sysdate + 1; /*如果沒有隔天檢測*/
end;
if v_nextdate is null then
v_nextdate := sysdate;
v_nexthours := to_number(to_char(v_nextdate, 'hh24')) + 1;
else
if v_nextdate
当前位置: 数据库>oracle
Oracle 用 Function 设定JOB时间
来源: 互联网 发布时间:2017-04-09
本文导语: create or replace function fn_get_myjob_interval return date is Result date; v_nextdate date; v_nexthours number;begin if to_number(to_char(sysdate, 'dd')) >= 25 then begin select max(t.activation_date) into v_nextdate from emesp.tp_pro...