declare
job1 number;
begin
dbms_job.submit(job1, 'pro_mzj_data1;', sysdate, 'sysdate+10/86400');
end;
begin
dbms_job.run(185);
end;
29 个解决方案
#1
begin
sys.dbms_job.submit(job => :job,
what => 'insert into test
select 1,sysdate from dual;',
next_date => to_date('07-12-2016 10:27:07', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'sysdate+5/24/60');
commit;
end;
/
SQL> select id,to_char(dd,'yyyy-mm-dd hh24:mi:ss') from test;
ID TO_CHAR(DD,'YYYY-MM
---------- -------------------
1 2016-12-07 10:22:07
1 2016-12-07 10:27:08
#2
你这个是用pl/sql软件 新建的job吗? 我添加的时候报错,不知道哪儿不对。
#3
begin
sys.dbms_job.submit(job => :job,
what => 'insert into test
select 1,sysdate from dual;',
next_date => to_date('07-12-2016 10:27:07', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'sysdate+5/24/60');
commit;
end;
/
SQL> select id,to_char(dd,'yyyy-mm-dd hh24:mi:ss') from test;
ID TO_CHAR(DD,'YYYY-MM
---------- -------------------
1 2016-12-07 10:22:07
1 2016-12-07 10:27:08
begin
sys.dbms_job.submit(job => :job,
what => 'insert into test
select 1,sysdate from dual;',
next_date => to_date('07-12-2016 10:27:07', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'sysdate+5/24/60');
commit;
end;
/
SQL> select id,to_char(dd,'yyyy-mm-dd hh24:mi:ss') from test;
ID TO_CHAR(DD,'YYYY-MM
---------- -------------------
1 2016-12-07 10:22:07
1 2016-12-07 10:27:08
#2
begin
sys.dbms_job.submit(job => :job,
what => 'insert into test
select 1,sysdate from dual;',
next_date => to_date('07-12-2016 10:27:07', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'sysdate+5/24/60');
commit;
end;
/
SQL> select id,to_char(dd,'yyyy-mm-dd hh24:mi:ss') from test;
ID TO_CHAR(DD,'YYYY-MM
---------- -------------------
1 2016-12-07 10:22:07
1 2016-12-07 10:27:08
你这个是用pl/sql软件 新建的job吗? 我添加的时候报错,不知道哪儿不对。
#3
begin
sys.dbms_job.submit(job => :job,
what => 'insert into test
select 1,sysdate from dual;',
next_date => to_date('07-12-2016 10:27:07', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'sysdate+5/24/60');
commit;
end;
SQL> select id,to_char(dd,'yyyy-mm-dd hh24:mi:ss') from test;
ID TO_CHAR(DD,'YYYY-MM
---------- -------------------
1 2016-12-07 10:22:07
1 2016-12-07 10:27:08
你这个是用pl/sql软件 新建的job吗? 我添加的时候报错,不知道哪儿不对。
begin
sys.dbms_job.submit(job => :job,
what => 'insert into test
select 1,sysdate from dual;',
next_date => to_date('07-12-2016 10:27:07', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'sysdate+5/24/60');
commit;
end;
/
SQL> select id,to_char(dd,'yyyy-mm-dd hh24:mi:ss') from test;
ID TO_CHAR(DD,'YYYY-MM
---------- -------------------
1 2016-12-07 10:22:07
1 2016-12-07 10:27:08