0

我对 PL/SQL 很陌生。我有以下代码:

 BEGIN
  DBMS_SCHEDULER.create_schedule (
    schedule_name   => 'By_Days_Of_Weak_Schedule',
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'freq=weekly; BYDAY=MON,TUE,WED');
END;
//Schedule created

create or replace 
PROCEDURE set_intervals_procedure (
    to_task_id   in number,
    repetitions_count   in number)

AS  
                interval_string   VARCHAR2(255);
                start_d           TIMESTAMP WITH TIME ZONE;
                return_date_after TIMESTAMP WITH TIME ZONE;
                next_run_date     TIMESTAMP WITH TIME ZONE; 
BEGIN                             
               Select START_DATE Into start_d From DBA_SCHEDULER_SCHEDULES 
                        WHERE SCHEDULE_NAME = 'BY_DAYS_OF_WEAK_SCHEDULE';

               Select REPEAT_INTERVAL Into interval_string From DBA_SCHEDULER_SCHEDULES 
                        WHERE SCHEDULE_NAME = 'BY_DAYS_OF_WEAK_SCHEDULE';

                return_date_after := start_d;
                FOR i IN 1..repetitions_count LOOP
                  DBMS_SCHEDULER.EVALUATE_CALENDAR_STRING(  
                     interval_string,
                    start_d, return_date_after, next_run_date);                                                                

                return_date_after := next_run_date;
                END LOOP;         
END set_intervals_procedure;

问题是它无法编译。它忽略了我的 Select 语句,尽管它们是正确的。有人可能会告诉我我错在哪里。谢谢

4

0 回答 0