I ran into an overload situation but can't seem to find out exactly why the following error is happening:
create or replace package pkg_overload
as
procedure overload(p_in in date);
procedure overload(p_in in timestamp);
end pkg_overload;
/
create or replace package body pkg_overload
as
procedure overload(p_in in date)
as
begin
dbms_output.put_line('overload > date');
end overload;
procedure overload(p_in in timestamp)
as
begin
dbms_output.put_line('overload > timestamp');
end overload;
end pkg_overload;
/
When I run the overloaded methods passing in sysdate and systimestamp I get an error on the timestamp:
exec pkg_overload.overload(sysdate);
overload > date
exec pkg_overload.overload(systimestamp);
Error starting at line 27 in command:
exec pkg_overload.overload(systimestamp)
Error report:
ORA-06550: line 1, column 7:
PLS-00307: too many declarations of 'OVERLOAD' match this call
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
It appears that Oracle is trying both the implicit conversion of the timestamp to date and no conversion, thus getting the PLS-00307 error. Can anyone provide more insight into this? Is their anyway around it (besides creating a uniquely named method for the timestamp procedure)?
Thanks,
Martin
-----
http://www.talkapex.com
http://www.clarifit.com