How to execute a procedure with DBMS_SCHEDULER.CREATE_JOB procedure

后端 未结 1 1892
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 00:34

I want to create a job that would drop a database object at a given date. The job created all right but the procedure is not executed. Tried executing the procedure alone an

相关标签:
1条回答
  • 2020-12-20 01:09

    It apears to me that you have missed some quote marks in the DBMS_JOBS setup call.

    Try this:

    DBMS_SCHEDULER.CREATE_JOB(job_name        => v_jobnam,
                              job_type        => 'PLSQL_BLOCK',
                              JOB_ACTION      => 'BEGIN DROP_OBJ1(''' || v_objnam 
                                                 || ''', ''' || v_objtyp || ''', '''
                                                 || v_schema || ''',' || v_objid 
                                                 || '); END;',
                              start_date      => SYSTIMESTAMP,
                              repeat_interval => 'freq=secondly; bysecond=0',
                              end_date        => NULL,
                              enabled         => TRUE,
                              comments        => 'Calls PLSQL once');
    

    If this is not the solution I will setup your code on a database and try it myself.

    0 讨论(0)
提交回复
热议问题