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    |

 

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.

 

 

By: John Kazerooni

-- 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);

 

Google
 
Web web site