I am trying to compile a package specification. I would like to include some type definitions and declare a function:
TYPE col_type AS OBJECT (
col_name VARCHAR2(50)
);
TYPE col_sub_type
IS TABLE OF
col_type;
FUNCTION get_col_tab RETURN col_sub_type;
And finally, the function get_col_tab
:
FUNCTION get_col_tab RETURN col_sub_type AS
l_type col_sub_type := col_sub_type();
BEGIN
FOR i IN (SELECT DISTINCT TABLE_NAME t_name FROM ALL_TAB_COLUMNS WHERE TABLE_NAME = 'TABLE_1') LOOP
l_type.extend;
l_type(l_type.last) := col_type(i.t_name);
END LOOP;
RETURN l_type;
END;
But when compiling the package specification, I get the following error:
PLS-00540: object is not supported in this context
As I understand it, I can not use the type OBJECT
in the package specification. Is there a workaround or another way to do this?
Thanks in advance.
dziki source
share