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!

PLS-00307: too many declarations - Overloaded method w. date and timestamp

Martin Giffy D'SouzaJan 19 2013 — edited Jan 20 2013
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
This post has been answered by JustinCave on Jan 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 17 2013
Added on Jan 19 2013
5 comments
2,545 views