Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difference between dbms_job.submit and dbms_job.run

835183Feb 16 2011 — edited Feb 17 2011
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2011
Added on Feb 16 2011
11 comments
1,040 views