Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting PLS-00306: "wrong number or types of arguments in call" while calling a sub proc from a main

JSMQApr 23 2018 — edited May 2 2018

Oracle version -11.02

Hi - Am getting this error-PLS-00306 while calling this proc from a main proc

CREATE OR REPLACE PROCEDURE RECORD (RUN IN INT) AS

  NUM_LOADS       INT;

  LAST_END_TIME   DATE;

  START_TIME DATE DEFAULT TRUNC(CURRENT_DATE - 7, 'DD');

  END_TIME   DATE DEFAULT TRUNC(CURRENT_DATE, 'DD') - 1 / (24 * 60 * 60);

  BEGIN

    SELECT COUNT(*) INTO NUM_LOADS FROM LOAD_CONT;

    IF to_char(CURRENT_DATE, 'DY') != 'SUN' AND RUN = 0

    THEN

      RAISE_APPLICATION_ERROR(-20101, 'Reports are run only on sundays');

    END IF;

    IF NUM_LOADS > 0

    THEN

      SELECT END_TIME INTO LAST_END_TIME FROM LOAD_CONT WHERE ROWNUM = 1 ORDER BY END_TIME DESC;

      IF START_TIME < LAST_END_TIME AND RUN < 2

      THEN

        RAISE_APPLICATION_ERROR(-20101, 'Report has already been run for this week');

      END IF;

    END IF;

    INSERT INTO LOAD_CONT (

      LOAD_ID,

      LOAD_DATE,

      START_TIME,

      END_TIME,

      LOAD_STATUS

    ) VALUES (

      LOAD_CONT_SEQ.nextval,

      CURRENT_DATE,

      P_THIS_START_TIME,

      P_THIS_END_TIME,

      NULL

    );

  END;

/

This post has been answered by mathguy on Apr 26 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2018
Added on Apr 23 2018
28 comments
5,876 views