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!

Default Parameters - too many declarations

175456Jan 25 2011 — edited Jan 25 2011
Hi,

I have 2 overloaded procedures in package A.

P1 (param1 varchar2,
param2 varchar2,
param3 varchar2,
param4 number,
param5 varchar2)

P1 (param1 varchar2,
param2 varchar2,
param3 varchar2,
param4 number,
param5 varchar2,
param6 varchar2)

Now I am adding a variable with default value to both of these methods. So this will be like this:

P1 (param1 varchar2,
param2 varchar2,
param3 varchar2,
param4 number,
param5 varchar2,
param6 number := NULL)

P1 (param1 varchar2,
param2 varchar2,
param3 varchar2,
param4 number,
param5 varchar2,
param6 varchar2,
param7 number := NULL)


Now if I call the procedure P1 with 6 parameters, it should go to the second method. But I am getting too many declarations. I understand that 6th parameter which I am using to call the method, can be the 6th parameter for the first method also. How to resolve this scenario? Even though the data type is different (the one I am passing is varchar2, but the default param in the first method is number), I am getting this error. Thanks in advance.
This post has been answered by JustinCave on Jan 25 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2011
Added on Jan 25 2011
2 comments
103 views