Имеется пакет, который прекрасно работает в 11g версии. Но если пытаюсь использовать его в 19c версии, то он компилируется без ошибок, но вывод результата отличается.
Вот воспроизводимый пример:
create table tbl1 (id number, description varchar2 (50));
/
create or replace package pkg1 is
cursor cur1 is
select id, description
from tbl1
where 1=2;
type curtype is table of cur1%rowtype;
function func (n number) return curtype pipelined;
end pkg1;
/
create or replace package body pkg1 is
function func (n number) return curtype pipelined as
tab curtype := curtype ();
begin
for i in 1..n loop tab.extend;
tab(i).id := i;
tab(i).description := 'test'||i;
pipe row (tab(i));
end loop;
return;
end;
end pkg1;
/
select * from table (pkg1.func (2));
Результат:
ATTR_1 ATTR_2
---------- --------------------------------------------------
1 test1
2 test2
Ожидал получить заголовки колонок как они определены в курсоре - ID, DESCRIPTION
.
Но в 19c получаю - ATTR_1, ATTR_2
.
Как можно изменить это поведение?