iSelfSchooling.com  Since 1999     References  |  Search more  | Oracle Syntax  | Free Online Oracle Training

    Home      .Services     Login       Start Learning     Certification      .                 .Share your BELIEF(s)...

 

. Online Accounting        .Copyright & User Agreement   |
    .Vision      .Biography     .Acknowledgement

.Contact Us      .Comments/Suggestions       Email2aFriend    |

 

Online Oracle Training for beginners and advanced - The most comprehensive Oracle tutorial

The authors do not guarantee or take any responsibility for the accuracy, or completeness of the information.

 

 

 

 

 

 

 

Lesson 28

"Nature is an unlimited broadcasting station, through which God speaks to us every hour, if we only will tune in." 

-George Washington Carver (1864-1943)

How to submit, run, and remove a job?

As a programmer you have been assigned to submit a job to run a stored procedure called “clean_the_tables” every one hour in Oracle.

 

-- Define “v_jobno” as a binding variable:

VARIABLE v_jobno NUMBER

 

-- Submit the job.

EXECUTE dbms_job.submit (:v_jobno, ‘clean_the_tables;’, sysdate, ‘sysdate + (1/24)’);

 

-- Print the job number

PRINT v_jobno

-OR-

SELECT :v_jobno FROM dual;

-OR-

SELECT job FROM user_jobs ORDER BY job;  -- the last number.

 

-- Run the job.

EXECUTE dbms_job.run (:v_jobno);

 

-- Remove the job.

EXECUTE dbms_remove(:v_jobno);