title: Overloading problem: Error(83,5): PLS-00307: too many declarations of 'REPORTEQ' match this call
body: <p>So I am trying to use overloading but I am having some troubles. My package has 4 procedures with the same name but different type of arguments (VARCHAR2, NUMBER, BOOLEAN, DATE). The package header and package body are at the end of my question.</p>
  
  <p>I am trying to use the package procedure like this:</p>
  
  <pre><code>OPEN bookCountCur;
  FETCH bookCountCur INTO how_many;
  testutil.reporteq('add procedure, book record count',
    expected_value =&gt; '1', actual_value =&gt; how_many);
  CLOSE bookCountCur;
  
  OPEN copiesCountCur;
  FETCH copiesCountCur INTO how_many;
  testutil.reporteq('add procedure, book copy record count',
    expected_value =&gt; '1', actual_value =&gt; how_many);
  CLOSE copiesCountCur;
  </code></pre>
  
  <p>And I am getting this compilation error:</p>
  
  <pre><code>Error(83,5): PLS-00307: too many declarations of 'REPORTEQ' match this call
  </code></pre>
  
  <p>What does it mean?</p>
  
  <hr>
  
  <p>Package header:</p>
  
  <pre><code>CREATE OR REPLACE 
  PACKAGE TESTUTIL AS 
  
    /* TODO enter package declarations (types, exceptions, methods etc) here */ 
  
    PROCEDURE reporteq(description IN VARCHAR2
    , expected_value IN VARCHAR2, actual_value IN VARCHAR2);
  
    PROCEDURE reporteq(description IN VARCHAR2
    , expected_value IN NUMBER, actual_value IN NUMBER);
  
    PROCEDURE reporteq(description IN VARCHAR2
    , expected_value IN BOOLEAN, actual_value IN BOOLEAN);
  
    PROCEDURE reporteq(description IN VARCHAR2
    , expected_value IN DATE, actual_value IN DATE);
  
  END TESTUTIL;
  </code></pre>
  
  <p>And the package body:</p>
  
  <pre><code>CREATE OR REPLACE
  PACKAGE BODY TESTUTIL AS
  
    PROCEDURE reporteq(description IN VARCHAR2
    , expected_value IN VARCHAR2, actual_value IN VARCHAR2) AS
    BEGIN
      DBMS_OUTPUT.PUT(description || ': ');
  
      IF expected_value = actual_value 
      OR expected_value IS NULL AND actual_value IS NULL
      THEN
        DBMS_OUTPUT.PUT_LINE('PASSED');
      ELSE
        DBMS_OUTPUT.PUT_LINE('FAILED. Expected ' || expected_value || '; got ' || actual_value);
      END IF;
    END reporteq;
  
    PROCEDURE reporteq(description IN VARCHAR2
    , expected_value IN NUMBER, actual_value IN NUMBER) AS 
    BEGIN
      DBMS_OUTPUT.PUT(description || ': ');
  
      IF expected_value = actual_value 
      OR expected_value IS NULL AND actual_value IS NULL
      THEN
        DBMS_OUTPUT.PUT_LINE('PASSED');
      ELSE
        DBMS_OUTPUT.PUT_LINE('FAILED. Expected ' || expected_value || '; got ' || actual_value);
      END IF;
    END reporteq;
  
    PROCEDURE reporteq(description IN VARCHAR2
    , expected_value IN BOOLEAN, actual_value IN BOOLEAN) 
    AS
      expected_value_tostr VARCHAR2(5);
      actual_value_tostr VARCHAR2(5); 
    BEGIN
      DBMS_OUTPUT.PUT(description || ': ');
  
      IF expected_value = actual_value 
      OR expected_value IS NULL AND actual_value IS NULL
      THEN
        DBMS_OUTPUT.PUT_LINE('PASSED');
      ELSE
        /* Transform TRUE/FALSE to 'TRUE'/'FALSE' */
        IF TRUE = expected_value
        THEN
          expected_value_tostr := 'TRUE';
        ELSE
          expected_value_tostr := 'FALSE';
        END IF;
        IF TRUE = actual_value
        THEN
          actual_value_tostr := 'TRUE';
        ELSE
          actual_value_tostr := 'FALSE';
        END IF;
        DBMS_OUTPUT.PUT_LINE('FAILED. Expected ' || expected_value_tostr || '; got ' || actual_value_tostr);
      END IF;
    END reporteq;
  
    PROCEDURE reporteq(description IN VARCHAR2
    , expected_value IN DATE, actual_value IN DATE) AS
    BEGIN
      DBMS_OUTPUT.PUT(description || ': ');
  
      IF expected_value = actual_value 
      OR expected_value IS NULL AND actual_value IS NULL
      THEN
        DBMS_OUTPUT.PUT_LINE('PASSED');
      ELSE
        DBMS_OUTPUT.PUT_LINE('FAILED. Expected ' || TO_CHAR(expected_value, 'YYYY/MM/DD') 
        || '; got ' || TO_CHAR(actual_value, 'YYYY/MM/DD'));
      END IF;
    END reporteq;
  
  END TESTUTIL;
  </code></pre>