Difference between dbms_job.submit and dbms_job.run
835183Feb 16 2011 — edited Feb 17 2011Hi All,
I am trying to understand where to use dbms_job.submit and dbms_job.run. The following is my understanding
The below code creates a job but the job doesnt run.
declare
v_jobno binary_integer;
begin
dbms_job.submit ( job => v_jobno,
what => 'testjob(JOB);',
next_date => sysdate + numtodsinterval(5,'minute')
*);*
dbms_output.put_line('Jobnumber: ' || v_jobno);
commit;
end;
to created and run the job the following code should be used
declare
v_jobno binary_integer;
begin
dbms_job.submit ( job => v_jobno,
what => 'testjob(JOB);',
next_date => sysdate + numtodsinterval(5,'minute')
);
dbms_output.put_line('Jobnumber: ' || v_jobno);
dbms_job.run(v_jobno); commit;
end;
Am i correct. Is my understaning correct or work. Please advice me where to used dbms_job.submit and dbms_job.run
Thanks
Sami