There are some restrictions on overloading: : Overloading « Function Procedure Packages « Oracle PL/SQL Tutorial






You can't overload standalone procedures or functions.

The second definition simply overwrites the first one.

You can't overload functions that differ only by the datatype of the return value.

If you need to implement this requirement, use overloaded procedures with OUT parameters.

SQL> declare
  2     function getArea(i_rad NUMBER) return NUMBER
  3      is
  4          v_pi NUMBER:=3.14;
  5      begin
  6         return v_pi * (i_rad ** 2);
  7      end;
  8      function getArea (i_length NUMBER, i_width NUMBER) return NUMBER
  9      is
 10      begin
 11         return i_length * i_width;
 12      end;
 13  begin
 14     DBMS_OUTPUT.put_line('Area (R=3): ' ||getArea(3));
 15     DBMS_OUTPUT.put_line('Area (R=3): ' ||getArea('3'));
 16  end;
 17  /
Area (R=3): 28.26
Area (R=3): 28.26

PL/SQL procedure successfully completed.








27.19.Overloading
27.19.1.Overloading calls
27.19.2.Number of parameters
27.19.3.Names of parameters
27.19.4.Datatype family of parameters
27.19.5.There are some restrictions on overloading:
27.19.6.More than one match was found so Oracle raised a special error.