当前位置: 代码迷 >> Oracle管理 >> dbms_job.submit有关问题
  详细解决方案

dbms_job.submit有关问题

热度:80   发布时间:2016-04-24 06:03:31.0
dbms_job.submit问题
SQL>   create   table   t1   (id   number);

Table   created.

SQL>   create   sequence   seq   start   with   1001   increment   by   1;

Sequence   created.

SQL>   insert   into   t1   values(seq.nextval);

1   row   created.

SQL>   commit;

Commit   complete.

SQL>   variable   n   number;
SQL>   begin
2   dbms_job.submit(:n, 'add_t1 ',sysdate, 'sysdate+1/1440/2 ');
3   commit;
4   end;
5   /
begin
*
ERROR   at   line   1:
ORA-06550:   line   1,   column   100:
PLS-00103:   Encountered   the   symbol   "END "   when   expecting   one   of   the   following:
:=   .   (   @   %   ;
The   symbol   "; "   was   substituted   for   "END "   to   continue.
ORA-06512:   at   "SYS.DBMS_JOB ",   line   79
ORA-06512:   at   "SYS.DBMS_JOB ",   line   136
ORA-06512:   at   line   2
是什么错误   怎么解决啊   本人菜鸟   刚学   ....



------解决方案--------------------
dbms_job.submit(:n, 'add_t1 ',sysdate, 'sysdate+1/1440/2 ')

注意分号, 'add_t1; '
------解决方案--------------------
BEGIN
VARIABLE n NUMBER;
dbms_job.submit(:n, 'add_t1 ', SYSDATE, 'sysdate+1/1440/2 ');
COMMIT;
END;
------解决方案--------------------
http://www.bitscn.com/oracle/optimize/200604/19366.html
  相关解决方案