创建一个job
declare job_OpAutoDta NUMBER;
begin
sys.dbms_job.submit( job=>:job_OpAutoDta,
what => 'pk_sys_department(1)',
next_date => to_date('22-03-2017 02:00:00','dd-mm-yyyy hh24:mi:ss'),
interval => 'trunc(sysdate+1)');
commit;
end;
执行后提示“ORA-01008 并非所有变量都已关联”。
解决:将“ declare job_OpAutoDta NUMBER;”修改为“declare job_OpAutoDta pls_integer;”
declare job_OpAutoDta pls_integer;
beginsys.dbms_job.submit(job =>job_OpAutoDta,
what => 'pk_sys_department(1);',--每天2点执行job
interval => 'trunc(sysdate+1)');
commit;
end;
原文链接:/oracle/210048.html