ORACLE存储过程定时器例子(存储过程变量赋值)

CREATE OR REPLACE PROCEDURE SP_DSSJTS_XMRSLOG
as
str1 varchar2(500);
str2 varchar2(500);
str3 varchar2(500);
begin
select 'xmrslog_'||extract(year from sysdate)||extract(month from sysdate)  Into str1 from dual;
str2:='create table '||str1||' as select * from xmrslog';
str3:='delete xmrslog';
EXECUTE immediate str2;
EXECUTE immediate str3;
commit;--有进行回滚事物的就需要提交
end;
begin
sys.dbms_scheduler.create_job(job_name => 'XMGWY.SJTS_XMRSLOG_JOB',
job_type => 'STORED_PROCEDURE',
job_action => 'SP_DSSJTS_XMRSLOG',
start_date => to_date('02-01-2019 01:10:00', 'dd-mm-yyyy hh24:mi:ss'),
repeat_interval => 'Freq=MONTHLY;Interval=1',
end_date => to_date(null),
job_class => 'DEFAULT_JOB_CLASS',
enabled => true,
auto_drop => false,
comments => '');
end;
/
上一篇:c++,纯虚函数与抽象类


下一篇:黄聪:WordPress 多站点建站教程(一):怎样开启WordPress多站点功能,实现手机移动端主题开发,与主站用户数据共享