How to schedule a job in pl/sql

oracle10gplsql

I have created one stored procedure with name

traffic_details_temp_send_mail;

How to make this procedure to run everyday at 10AM?

Please help with block of code.

Thanks in advance.

Best Answer

you can create a scheduler job:

begin
    dbms_scheduler.create_job(job_name        => 'TRAFFIC_DETAILS_JOB',
                              job_type        => 'STORED_PROCEDURE',
                              job_action      => 'traffic_details_temp_send_mail',
                              start_date      => systimestamp,
                              end_date        => null,
                              repeat_interval => 'freq=daily; byhour=10; byminute=0; bysecond=0;',
                              enabled         => true,
                              auto_drop       => false,
                              comments        => 'your description here.');
end;
/

then you can see the details in the scheduler job views (user_scheduler_jobs etc). see here for information on scehduler jobs.

Related Topic