create or replace procedure errormap
is
begin
--八大异常之一 挂牌价为0或者空
delete T where type='1';
insert into T(NAME,VALUE1,VALUE2,type)
select NAME,VALUE1,VALUE2,type from T2
COMMIT;
end;
declare
job number;
BEGIN
DBMS_JOB.SUBMIT(
JOB => job, /*自动生成JOB_ID*/
WHAT => 'ERRORMAP;', /*需要执行的过程或SQL语句*/
NEXT_DATE => sysdate,
INTERVAL => 'TRUNC(sysdate+1)+1/24' /*每天01点*/
);
COMMIT;
DBMS_JOB.RUN(job);
end;