Witam.
Napisałem funkcję która zwraca tabelę. Przy jej wywołaniu select * from table(test_package_1.test_function()); wyrzuca błąd 'ORA-00902: niepoprawny typ danych'.
Co jest nie tak z moim kodem?
create or replace package test_package_1 is
type test_record is record
(
a VARCHAR2(50),
b VARCHAR2(50)
);
type test_table is table of test_record;
FUNCTION test_function RETURN test_table;
end;
create or replace package body test_package_1 is
function test_function return test_table is
t test_table;
begin
t.extend;
t(1).a := 'a';
t(1).b := 'a';
t.extend;
t(2).a := 'a;
t(2).b := 'b';
return t;
end test_function;
end test_package_1;