Oracle: Create a Job Script

Hi,

Below is the syntax for creating a JOB in Oracle


CREATE OR REPLACE PROCEDURE MySchema.Create_A_JOB

AS

BEGIN

DECLARE

X NUMBER;

BEGIN

SYS.<strong><em>DBMS_JOB.SUBMIT</em></strong>

( job       => X

,what      => 'MySchema.Call_The_Procedure(''10'');'

,next_date => to_date('15/04/2015 13:35:00','dd/mm/yyyy hh24:mi:ss')

,interval  => 'SYSDATE + 1'

,no_parse  => FALSE

);

SYS.<strong><em>DBMS_OUTPUT.PUT_LINE</em></strong>('Job Number is: ' || to_char(x));

SYS.<strong><em>DBMS_JOB.BROKEN</em></strong>

(job    => X,

broken => TRUE);

COMMIT;

END;

END;

/