CSDN博客

img tesge

job简介

发表于2004/6/28 20:30:00  967人阅读

variable job1 number;
begin
dbms_job.submit(:job1,'p_test1;',sysdate+1/1440, 'trunc(sysdate)+1+11/24');  
end;

create or replace procedure p_dwry
as
begin
 execute immediate 'TRUNCATE TABLE tj_dwry';
 insert into tj_dwry select * from v_dwry;
 commit;
end;


--创建JOB
variable job1 number;
begin
dbms_job.submit(:job1,'p_dwry;',sysdate,'sysdate+1/1440');  --每天1440分钟,即一分钟运行test过程一次
end;
/

--运行JOB
begin
dbms_job.run(:job1);
end;
/
--删除JOB
begin
 dbms_job.remove(:job1);
end;
 /


--查询job
 select job,to_char(next_date,'yyyy-mm-dd hh24:mi:ss') from all_jobs;


--查看当前时间
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;


 

 

 

0 0

相关博文

我的热门文章

img
取 消
img