Test window for overloaded package function

fraenkg

Member³
In a package there are several functions with the same name, which only differ in terms of their parameters.
If one of these functions is selected in the content list and requested via context menu 'Test', a test window is provided. However, without a parameter list.

begin
-- Call the function
PCK1.FCK02;
end;

This behavior does not change even if only (this) one function is present in the specification.
As a work around, you can comment out the other functions of the same name in the program body. Then you also get the parameter list for the call in the test window.
 
Last edited:
I've attached a small example package to the description text here.

In my normal work I only have the package body in the view. The specification rarely changes. Therefore, I usually open a test window by selecting the relevant function in the content tree of the package body (context menu: Test). When I do that, I get the following result in the example case:
(I use the function with the 2 in out parameters, which is also in the specification.)
begin
-- Call the function
TST.Test;
end;

If I comment out the 1st function (with the one in out parameter) in the package body and repeat the above test, I get the desired result.
When trying the test package, I noticed that it also works when "test" is requested via the content tree of the package specification.
But as I said, I usually only work with package bodies.

create or replace package TST
as
function Test(
finPar1 in pls_integer default 0
,finPar2 in integer
,fbnPar3 in out integer
,fbnPar4 in out integer
,fisPar5 in varchar2 default null
)
return pls_integer;
end TST;

create or replace package body TST
as
function Test(
finPar1 in pls_integer default 0
,finPar2 in integer
,fbnPar3 in out integer
,fisPar5 in varchar2 default null
)
return pls_integer is
begin
return(1);
end Test;

function Test(
finPar1 in pls_integer default 0
,finPar2 in integer
,fbnPar3 in out integer
,fbnPar4 in out integer
,fisPar5 in varchar2 default null
)
return pls_integer is
begin
return(2);
end Test;
end TST;
 
Back
Top