Toad World® Forums

Stub generation does not work for type out arguments anymores since 6.0

**Hi!

Under 5.5 there was a lot of support for executing out type out arguments, this is missing since 6.0:**

Create following package:

CREATE OR REPLACE PACKAGE PK_TEST_TYPES IS
TYPE tRec IS RECORD(
a VARCHAR2(1)
, b VARCHAR2(1)
);

TYPE tTab IS TABLE OF tRec;

PROCEDURE pr_rec(vRec OUT tRec);

PROCEDURE pr_tab(vTab OUT tTab);
END;
/
CREATE OR REPLACE PACKAGE BODY PK_TEST_TYPES IS
PROCEDURE pr_rec(vRec OUT tRec) IS
BEGIN
NULL;
END pr_rec;

PROCEDURE pr_tab(vTab OUT tTab) IS
BEGIN
NULL;
END pr_tab;
END;
/

Then execute the procedures as stub:
under 5.5
DECLARE
vrec PK_TEST_TYPES.TREC;
BEGIN

– Now call the stored program
pk_test_types.pr_rec(vrec);

– Output the results
dbms_output.put_line(SubStr('vrec.A = '||vrec.A,1,255));
dbms_output.put_line(SubStr('vrec.B = '||vrec.B,1,255));

END;

DECLARE
vrec PK_TEST_TYPES.TREC;
BEGIN

– Now call the stored program
pk_test_types.pr_rec(vrec);

– Output the results
dbms_output.put_line(SubStr('vrec.A = '||vrec.A,1,255));
dbms_output.put_line(SubStr('vrec.B = '||vrec.B,1,255));

END;

under 6.2.1:
– Parameters of unsupported types detected.
– Please modify the code below manually.

DECLARE
vrec pk_test_types.trec;
BEGIN
pk_test_types.pr_rec(
vrec=>vrec);
END;
– Parameters of unsupported types detected.
– Please modify the code below manually.

DECLARE
vtab pk_test_types.ttab;
BEGIN
pk_test_types.pr_tab(
vtab=>vtab);
END;

Hi Torsten,

This is on our list to be fixed for 6.3.

Cheers
Gwen

This works now for the example showed above in 6.3.0.1796. Following a complexer example with table types, which does not work as in 5.5:

First recreate the package:

CREATE OR REPLACE PACKAGE PK_TEST_TYPES IS
TYPE tRec IS RECORD(
a VARCHAR2(1)
, b VARCHAR2(1)
);

TYPE tTab IS TABLE OF tRec;

PROCEDURE pr_rec(i_vRec IN tRec, o_vRec OUT tRec);

PROCEDURE pr_tab(i_tTab IN tTab, o_tTab OUT tTab);
END;
/
CREATE OR REPLACE PACKAGE BODY PK_TEST_TYPES IS
PROCEDURE pr_rec(i_vRec IN tRec, o_vRec OUT tRec) IS
BEGIN
o_vRec.a := i_vRec.b;
o_vRec.b := i_vRec.a;
END pr_rec;

PROCEDURE pr_tab(i_tTab IN tTab, o_tTab OUT tTab) IS
BEGIN
o_tTab := i_tTab;
END pr_tab;
END;
/

Enter Parameters A and B in the execute wizard.

The stub from 5.5:

CREATE OR REPLACE PACKAGE PK_TEST_TYPES IS
TYPE tRec IS RECORD(
a VARCHAR2(1)
, b VARCHAR2(1)
);

TYPE tTab IS TABLE OF tRec;

PROCEDURE pr_rec(i_vRec IN tRec, o_vRec OUT tRec);

PROCEDURE pr_tab(i_tTab IN tTab, o_tTab OUT tTab);
END;
/
CREATE OR REPLACE PACKAGE BODY PK_TEST_TYPES IS
PROCEDURE pr_rec(i_vRec IN tRec, o_vRec OUT tRec) IS
BEGIN
o_vRec.a := i_vRec.b;
o_vRec.b := i_vRec.a;
END pr_rec;

PROCEDURE pr_tab(i_tTab IN tTab, o_tTab OUT tTab) IS
BEGIN
o_tTab := i_tTab;
END pr_tab;
END;
/

The stub from 6.3.0.1796:
ECLARE
i_ttab s205031.pk_test_types.ttab;
o_ttab s205031.pk_test_types.ttab;
BEGIN
– Now Call the stored program
s205031.pk_test_types.pr_tab
(i_ttab=>i_ttab,
o_ttab=>o_ttab);
– Output the results
:a0 := O_TTAB(1).A;
:a1 := O_TTAB(1).B;
END;

Here is the assignment section missing.

A good enhancement would be, if I could create rows for the input table parameter. Actually in both version I can only enter row 1 for such parameters and have to modify later the stub. This would helpful for code testing too.

No change in 6.3.0.1824.

No change in 6.4.0.1901.

No change in 6.5.0.2032.

No change in 6.6.0.2220.

Hi Torsten,

Thanks for your checking and reporting.

This issue does exist in our latest build.

I have raised CR14171 for this issue, and CR14170 for the enhancement request.

Will let you know when fixed.

Thanks and regards,
Shirly