[英]Oracle dbms_scheduler.create_job Error
I am trying to create a simple scheduled event in an oracle 10g database. 我正在尝试在oracle 10g数据库中创建一个简单的预定事件。 I have been trying to use dbms_scheduler.create_job.
我一直在尝试使用dbms_scheduler.create_job。 Here is the script I wrote:
这是我写的脚本:
begin dbms_scheduler.create_job (
开始dbms_scheduler.create_job(
job_name => 'disengagementChecker',
job_name =>'disengagementChecker',
job_type => 'PLSQL_BLOCK',
job_type =>'PLSQL_BLOCK',
job_action => 'INSERT INTO PatientClassRelObs(patientClassID,observationTypeID) VALUES (1, 11)',
job_action =>'INSERT INTO PatientClassRelObs(PatientClassID,observationTypeID)VALUES(1,11)',
start_date => SYSDATE,
start_date => SYSDATE,
repeat_interval => 'FREQ=MINUTELY;INTERVAL=1',
repeat_interval =>'FREQ = MINUTELY; INTERVAL = 1',
comments => 'Iam tesing scheduler');
评论=>'Iam tesing调度程序'); end;
结束;
When I run this, oracle throws these errors 当我运行它时,oracle抛出这些错误
ORA-06550: line 15, column 3:
ORA-06550:第15行,第3列:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
PLS-00103:预期以下情况之一时遇到符号“文件结束”:
;
; The symbol ";"
符号“;” was substituted for "end-of-file" to continue.
被替换为“文件结束”以继续。
I don't understand whats causes this error. 我不知道是什么导致此错误。 Do you know what causes this error?
您知道导致此错误的原因吗? Or why this is happening?
还是为什么会这样?
Thank you in advance! 先感谢您!
-David -大卫
JOB_ACTION
must be a valid PL/SQL block, not just a valid SQL statement. JOB_ACTION
必须是有效的PL / SQL块,而不仅仅是有效的SQL语句。 Use this: 用这个:
job_action => '
BEGIN
INSERT INTO PatientClassRelObs(patientClassID,observationTypeID)
VALUES (1, 11);
END;',
UPDATE 更新
Maybe this is a problem with a specific environment or some code not posted. 也许这是特定环境的问题或某些未发布的代码。 To troubleshoot, start with something that's known to work, and add one small change at a time until something breaks.
要进行故障排除,请先从已知有效的方法开始,然后一次添加一个小的更改,直到出现问题为止。
Start with this code, using SQL*Plus. 使用SQL * Plus从此代码开始。
SQL> begin
2 dbms_scheduler.create_job(
3 job_name => 'TEST_JOB',
4 job_type => 'PLSQL_BLOCK',
5 job_action => 'BEGIN NULL; END;',
6 start_date => systimestamp,
7 enabled => true);
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> select status, log_date from dba_scheduler_job_run_details where job_name = 'TEST_JOB';
STATUS LOG_DATE
------------------------------ ---------------------------------------------------------------------------
SUCCEEDED 26-MAR-14 11.37.59.533000 PM -05:00
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.