Oracle - PLS-00103: Encountered the symbol “END” when try to create JOB

ぐ巨炮叔叔 提交于 2019-12-11 08:39:39

问题


i have a problem here, i already have a Stored Procedure called "SP_DEL_TOKEN" and i wanna make a job to run the Stored procedure automatically everyday..

this is my script to make the job

VAR jobno NUMBER;
BEGIN
DBMS_JOB.SUBMIT(:jobno, 'SP_DEL_TOKEN', SYSDATE, 'SYSDATE+1');
COMMIT;
END;
/

but when i do that script, i encountered with this error

ERROR at line 1:
ORA-06550: line 1, column 106:
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

please help me, and thanks for helping me :)


回答1:


You need a semicolon at the end of the "what" parameter. Use 'SP_DEL_TOKEN;' instead of 'SP_DEL_TOKEN'. See the manual for some more examples.

I'm not sure why this is. With dynamic SQL you cannot have a semicolon, and with dynamic PL/SQL you need the BEGIN and END;. I guess this parameter is used in some weird context.



来源:https://stackoverflow.com/questions/13023625/oracle-pls-00103-encountered-the-symbol-end-when-try-to-create-job

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!