📜  如果不存在,oracle 创建作业 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:18.936000             🧑  作者: Mango

代码示例1
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;