I'm using Oracle12c. I'm working with DBMS_SCHEDULER to execute a procedure every minute. I want to pass one argument to this procedure with the current datetime (SYSDATE) in each execution.
But this argument is evaluated just one time, when I create the job. Then, in every consecutive executions, the value of the argument is always the same (the create job date).
-- procedure signature
test_proc(v_aud_date in date);
-- scheduler_job
begin
dbms_scheduler.create_job (
job_name => 'test_JOB'
, job_type => 'STORED_PROCEDURE'
, job_action => 'test_proc'
, number_of_arguments => 1
, start_date => SYSTIMESTAMP
, repeat_interval => 'freq=minutely; interval=1;'
);
dbms_scheduler.set_job_anydata_value(
job_name => 'test_JOB'
, argument_position => 1
, argument_value => sys.anydata.convertDate(sysdate)
);
dbms_scheduler.enable('test_JOB');
end;
I want to get the current SYSDATE for every execution. I can't change the procedure. Is a black box for me.
Is it possible with DBMS_SCHEDULER?
P.S.: Probably I've made mistakes... Sorry for my English!