1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Difference between dbms_job.submit and calling a procedure?

Discussion in 'SQL PL/SQL' started by Anilshavkaru, Dec 24, 2015.

  1. Anilshavkaru

    Anilshavkaru Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    Hi All,

    Can you please explain the difference between calling a procedure using DBMS_JOB.SUBMIT and calling procedure in a pl/sql block using
    begin
    test();
    end; --(Lets say test is the procedure name).

    Thanks,
    Anil S
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    DBMS_JOB schedules a repeated task; using a PL/SQL block only runs the procedure once. The SUBMIT procedure requires much more input to allow Oracle to create the job schedule and monitor its progress, success or failure. Even though DBMS_JOB is still available it's recommended to learn and use DBMS_SCHEDULER for such tasks.
     
  3. Anilshavkaru

    Anilshavkaru Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    Hi Zargon,
    Thanks for the info.