您的位置:首頁技術文章
文章詳情頁

講解Oracle中JOB與存儲過程的接合用法

瀏覽:107日期:2023-11-27 11:24:16
本文主要介紹了Oracle數據庫中JOB與存儲過程的接合用法,具體示例請參考下文:

create or replace procedure TT isbegin update infoopen set checktype = 2 where floor(to_date(to_char(limittime, 'yyyy-MM-dd'), 'yyyy-MM-dd') -sysdate)<=5 and status<> 2 and checktype<>1; --顯示即將超時 update infoopen set isovertime = 1 where finishtime > limittime and status = 2; --超時處理 update infoopen set isovertime = 2 where finishtime < limittime and status = 2; --沒有超時處理 dbms_output.put_line('處理成功!');end TT;執行JOBVARIABLE JOBNO NUMBER;BEGINDBMS_JOB.SUBMIT(:JOBNO,'TT;',SYSDATE,'SYSDATE+1');COMMIT;END;/BEGINDBMS_JOB.RUN(:JOBNO);END;/移除JOBexec dbms_job.remove(:JOB1);exec dbms_job.remove(190);COMMIT;/查看JOBselect * from dba_jobs;

標簽: Oracle 數據庫
国产综合久久一区二区三区