Hi,
The following procedure execute a scheculer.
create or replace procedure GENERATE_LOAD_TYPE (p_module_type in varchar2)
as
cursor c is
select id,view_name
from poc_test
where view_name='POC_AD0FFFKMZ6QQ0';
Begin
for c_rec in c loop
BEGIN
DBMS_SCHEDULER.create_job (
job_name => c_rec.view_name||'_job',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN POC_LOADER('||c_rec.id||','||c_rec.view_name||'); commit; END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'SYSTIMESTAMP + 365 /* 1 Year */',
enabled => TRUE);
exit;
END;
end loop;
end;
exec GENERATE_LOAD_TYPE('1');
PL/SQL procedure successfully completed.
But the Job is failed on the follwoing error message:
select additional_info from DBA_SCHEDULER_JOB_LOG where job_name='POC_AD0FFFKMZ6QQ0_JOB'
ORA-06550: line ORA-06550: line 1, column 505:
PLS-00357: Table,View Or Sequence reference 'POC_AD0FFFKMZ6QQ0' not allowed in this context
ORA-06550: line 1, column 476:
PL/SQL: Statement ignored , column :
The problem is related to this line :
job_action => 'BEGIN POC_LOADER('||c_rec.id||','||c_rec.view_name||'); commit; END;',
When i remove the parameters (e.g: c_rec.id||','||c_rec.view_name) its worked fine.
Please advice .
Thanks