SUBMIT v16

The SUBMIT procedure creates a job definition and stores it in the database. A job consists of:

  • A job identifier
  • The stored procedure to execute
  • When to first run the job
  • A date function that calculates the next date/time for the job to run
SUBMIT(<job> OUT BINARY_INTEGER, <what> VARCHAR2
  [, <next_date> DATE [, <interval> VARCHAR2 [, <no_parse> BOOLEAN ]]])

Parameters

job

Identifier assigned to the job.

what

Name of the stored procedure for the job to execute.

next_date

Date/time to run the job next. The default is SYSDATE.

interval

Date function that, when evaluated, provides the next date/time for the job to run. If interval is set to null, then the job runs only once. Null is the default.

no_parse

If set to TRUE, don't syntax-check the stored procedure upon job creation. Check only when the job first executes. If set to FALSE, check the procedure upon job creation. The default is FALSE.

Note

The no_parse option isn't supported in this implementation of SUBMIT(). It's included only for compatibility.

Examples

This example creates a job using the stored procedure job_proc. The job executes immediately and runs once a day after that, as set by the interval parameter, SYSDATE + 1.

DECLARE
    jobid INTEGER;
BEGIN
    DBMS_JOB.SUBMIT(jobid,'job_proc;',SYSDATE,
        'SYSDATE + 1');
    DBMS_OUTPUT.PUT_LINE('jobid: ' || jobid);
END;

jobid: 104

The job immediately executes the procedure job_proc, populating the table jobrun with a row:

SELECT * FROM jobrun;
Output
            runtime
-------------------------------------
 job_proc run at 2007-12-11 11:43:25
(1 row)