Im not clear about this, here in DBMS_SCHEDULER we have CREATE_PROGRAM CREATE_JOB CREATE_SCHEDULE etc., after reading the oracle doc still im unclear what to use, On the Oracle side, i am going to use DBMS_SCHEDULER to insert a new message into the queue at the appropriate time, i planned to create scheduler to execute it on particular time and then create program to execute my PL/SQL block which will enqueue the message in the queue Or instead of using CREATE_SCHEDULE and CREATE_PROGRAM, CREATE_JOB does both the jobs, which to use? please guide me whether i am doing correctly, if not please correct me.
Thankyou
create_job
is the basic call to schedule a call. you don't have to create a named program or schedule to do this. where creating a named program/schedule is useful, is if you have several jobs that want to use this call. you can just reference the named program schedule instead of having each job hold a copy of that.e.g. if you had 5 jobs wanting to call your package
MYPKG.ENTRY_PROG(param)
and each job just used a different parameter value, i'd say you want to usecreate_program
to define that pl/sql call and thencreate_job
to reference that program name + set the parameter value of choice. that way, if you want to rename the API later or something, you don't have to change five seperate jobs to do this.If your job is just a standalone job that calls a routine that won't be called by other jobs, then you don't have to use
create_program
/create_schedule
, just usecreate_job
directly.one example where I used
create_program
was to call a test harness. my test harness package is calledpkg_test_harness.queue_tests(p_set_name in varchar2)
so I have a few jobs defined that enqueues various APIs to be run at 9AM, 12PM and 5PM. instead of defining each jobs call separately i just calledcreate_program
like:and then each "job" was defined pointing to the program.
i didn't create a named schedule, as these schedules are unique to the individual job.