我正在用确定的repeat_interval 做一份工作。我的目标是从表中检索该值,以便之后可以在表中更改该值并相应地修改作业。为此,我做了以下触发器:
CREATE OR REPLACE TRIGGER config_table_aur AFTER
UPDATE OF value ON config_table FOR EACH row WHEN (new.property = 'job_interval') DECLARE v_job NUMBER;
BEGIN
dbms_job.submit (v_job, 'begin
update_interval (' || :new.value || ');
end;');
END;
此触发器调用以下过程:
CREATE OR REPLACE
PROCEDURE update_interval(
p_new_interval IN config_table.value%type)
AS
BEGIN
dbms_scheduler.set_attribute ('jobu', 'repeat_interval', p_new_interval);
END update_interval;
其中 p_new_interval 是我从表中检索的值。我遇到的问题是,如果我尝试在表中设置一个值,如下所示:
FREQ=DAILY; INTERVAL=1;
然后我收到一条错误消息:
Fila 1: ORA-06550: line 2, column 46:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
year month day hour minute second
The symbol ";" was ignored.
ORA-06512: at "SYS.DBMS_JOB", line 82
ORA-06512: at "SYS.DBMS_JOB", line 140
ORA-06512: at "SOMESCHEMA.CONFIG_TABLE_AUR", line 3
ORA-04088: error during execution of trigger 'SOMESCHEMA.CONFIG_TABLE_AUR'
我猜问题是属性值包含分号';' 因为如果我不使用它们,我不会得到错误。
你有什么建议来规避这个问题吗?
谢谢