Tuesday, October 15, 2013

Oracle: create job to be run @ now +10 sec.

NB: Beware to not use SYSTIMESTAMP because start_date is a TIMESTAMP WITH TIME ZONE
set serveroutput on;
begin
    dbms_output.put_line(CURRENT_TIMESTAMP);
    dbms_scheduler.create_job (
        job_name            => 'TEST_JOB',
        job_type            => 'STORED_PROCEDURE',
        job_action          => 'PROV_DB.PROV_API.testtesttest',
        start_date          => CURRENT_TIMESTAMP + 10/86400,
        enabled             => TRUE);
end;