返回顶部

收藏

Oracle的定时器使用示例

更多
--Oracle定时job
--数据库执行此脚本时时,请确保只执行一次,否则会引发错误!
declare job_id number;  
begin  
dbms_job.submit(job_id,'Reinsure_Writeback_Opdate;',sysdate,'sysdate+1/(24*60)');  
commit;  
END;
/

--存储过程
create or replace procedure Reinsure_Writeback_Opdate as
begin
  update WEB_RI_SETT_MAIN B
     set B.C_RP_FLAG =
         (select case
                   when C.OPDATE is null then
                    '0'
                   else
                    '1'
                 end
            from web_fin_write_back C
           where C.BATCHNO = B.C_SETT_NO)
   where exists
   (select 1 from web_fin_write_back C where C.BATCHNO = B.C_SETT_NO);
   commit;
end Reinsure_Writeback_Opdate;

标签:sql

收藏

0人收藏

支持

0

反对

0

发表评论