Question

I have googled around for this error but seems my problem is unique. I am trying to schedule a procedure inside a package in Oracle 11g. I have create a package and a procedure successfully. Now I need to schedule this package to execute every day at 2200hrs, begining today at 1710hrs. I have written a scheduler like this:

BEGIN
  SYS.DBMS_SCHEDULER.CREATE_PROGRAM
    (
      program_name         => 'SIMBABI.EXTRACTOR'
     ,program_type         => 'STORED_PROCEDURE'
     ,program_action       => 'SIMBABI.BIEXTRACTOR.SIMBABIEXTRACTOR'
     ,start_date=> trunc(sysdate)+17.10/24
     ,repeat_interval=> 'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI,SAT,SUN; BYHOUR=22;'
     ,enabled              => TRUE
     ,number_of_arguments     =>  0
     ,auto_drop=>false
     ,comments             => 'EXTRACTION FOR BI DATA'
    );

  SYS.DBMS_SCHEDULER.ENABLE
    (name                  => 'SIMBABI.EXTRACTOR');
END;
/

I do not have any arguments either in my procedure or Package:

CREATE OR REPLACE package body SIMBABI.biextractor as
procedure SIMBABIEXTRACTOR is
begin
insert into general_accounts_master
select foracid,
          acid,
          acct_n......

When I try to compile my scheduler I am getting the error:

PLS-00306: wrong number or types of arguments in call to 'CREATE_PROGRAM'

What am I doing Not Right??

Was it helpful?

Solution

You are supplying some arguments that CREATE_PROGRAM doesn't have.

Those extra arguments are valid for CREATE_SCHEDULE or CREATE_JOB, but not for CREATE_PROGRAM.

CREATE_PROGRAM accepts the following arguments:

DBMS_SCHEDULER.CREATE_PROGRAM (
   program_name             IN VARCHAR2,
   program_type             IN VARCHAR2,
   program_action           IN VARCHAR2,
   number_of_arguments      IN PLS_INTEGER DEFAULT 0,
   enabled                  IN BOOLEAN DEFAULT FALSE,
   comments                 IN VARCHAR2 DEFAULT NULL);

After creating the program, you can use CREATE_SCHEDULE or CREATE_JOB to schedule the execution of the program.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top