给你一个例子: Create Or Replace Procedure Auto_Cljs_Job (v_timestr In Varchar2,v_jobno Out Varchar2,v_msg Out Varchar2) Is/****************************************************************************** PURPOSE: 自动潮流计算Job的建立与更改 REVISIONS: Ver Date Author Description --------- ---------- --------------- ------------------------------------ 1.0 2003-10-17 Fred Zhang 1. Created this procedure. ******************************************************************************/ jobno Integer; jobid Integer; Begin Select job Into jobid From all_jobs Where what='AUTO_CLJS;'; dbms_job.Change(jobid,'AUTO_CLJS;',To_Date(To_Char(Sysdate,'yyyy-mm-dd')||' '||V_timestr,'yyyy-mm-dd hh24:mi:ss'),'trunc(sysdate,''mi'')+1'); Commit; v_jobno:=jobid; v_msg:='恭喜你!自动计算设定已经成功更改!'; Exception When No_Data_Found Then dbms_job.submit(jobid,'AUTO_CLJS;',To_Date(To_Char(Sysdate,'yyyy-mm-dd')||' '||V_timestr,'yyyy-mm-dd hh24:mi:ss'),'trunc(sysdate,''mi'')+1'); Commit; v_jobno:=jobid; v_msg:='恭喜你!自动计算已经成功设定!'; End Auto_Cljs_Job;
Create Or Replace Procedure Auto_Cljs_Job (v_timestr In Varchar2,v_jobno Out Varchar2,v_msg Out Varchar2) Is/******************************************************************************
PURPOSE: 自动潮流计算Job的建立与更改 REVISIONS:
Ver Date Author Description
--------- ---------- --------------- ------------------------------------
1.0 2003-10-17 Fred Zhang 1. Created this procedure.
******************************************************************************/
jobno Integer;
jobid Integer;
Begin
Select job Into jobid From all_jobs Where what='AUTO_CLJS;';
dbms_job.Change(jobid,'AUTO_CLJS;',To_Date(To_Char(Sysdate,'yyyy-mm-dd')||' '||V_timestr,'yyyy-mm-dd hh24:mi:ss'),'trunc(sysdate,''mi'')+1');
Commit;
v_jobno:=jobid;
v_msg:='恭喜你!自动计算设定已经成功更改!';
Exception When No_Data_Found Then
dbms_job.submit(jobid,'AUTO_CLJS;',To_Date(To_Char(Sysdate,'yyyy-mm-dd')||' '||V_timestr,'yyyy-mm-dd hh24:mi:ss'),'trunc(sysdate,''mi'')+1');
Commit;
v_jobno:=jobid;
v_msg:='恭喜你!自动计算已经成功设定!'; End Auto_Cljs_Job;