The SUBMIT procedure creates a job definition and stores it in the database.
A job consists of a job identifier, the stored procedure to be executed, when the job is first executed, and a date function that calculates the next date and time for the job to be run.
>>-DBMS_JOB.SUBMIT--(--job--,--what-----------------------------> >--+------------------------------------------------+--)------->< '-,--next_date--+------------------------------+-' '-,--interval--+-------------+-' '-,--no_parse-'
EXECUTE privilege on the DBMS_JOB module.
SET SERVEROUTPUT ON@
BEGIN
DECLARE jobid INTEGER;
CALL DBMS_JOB.SUBMIT(jobid,'CALL job_proc();',SYSDATE + 5 minutes, 'SYSDATE + 1');
CALL DBMS_OUTPUT.PUT_LINE('jobid: ' || jobid);
END@
The output from this command is as follows:SET SERVEROUTPUT ON
DB20000I The SET SERVEROUTPUT command completed successfully.
BEGIN
DECLARE jobid INTEGER;
CALL DBMS_JOB.SUBMIT(jobid,'CALL job_proc();',SYSDATE + 5 minutes, 'SYSDATE + 1');
CALL DBMS_OUTPUT.PUT_LINE('jobid: ' || jobid);
END
DB20000I The SQL command completed successfully.
jobid: 1