Print Thread
Test window for overloaded package function
#63586 03/09/22 07:40 PM
Joined: Dec 2001
Posts: 236
berlin
F
fraenkg Offline OP
Member
OP Offline
Member
F
Joined: Dec 2001
Posts: 236
berlin
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 by fraenkg; 03/09/22 07:51 PM.
Re: Test window for overloaded package function
fraenkg #63593 03/10/22 10:07 AM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
This seems to work fine for me. Can you send me the package specification?


Marco Kalter
Allround Automations
Re: Test window for overloaded package function
fraenkg #63615 03/11/22 03:06 PM
Joined: Dec 2001
Posts: 236
berlin
F
fraenkg Offline OP
Member
OP Offline
Member
F
Joined: Dec 2001
Posts: 236
berlin
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;


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.120s Queries: 14 (0.049s) Memory: 2.5052 MB (Peak: 3.0394 MB) Data Comp: Off Server Time: 2024-05-21 10:46:02 UTC
Valid HTML 5 and Valid CSS