Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

oracle create job if not exists

DECLARE
    l_job_exists NUMBER;
BEGIN
    SELECT count(*) INTO l_job_exists
    FROM all_scheduler_jobs WHERE job_name = 'job_name' AND OWNER = 'owner';
    IF l_job_exists = 1 THEN
        dbms_scheduler.drop_job(job_name => 'job_name');
    END IF;
END;
/
BEGIN DBMS_SCHEDULER.CREATE_JOB(job_name => '"owner"."job_name"', ...); END;
 
PREVIOUS NEXT
Tagged: #oracle #create #job #exists
ADD COMMENT
Topic
Name
6+5 =