Search notes:
ORA-22905: cannot access rows from a non-nested table item
create type tq84_t as object (dummy char(1));
/
create or replace function tq84_ora_22905 return tq84_t is begin return tq84_t('x'); end;
/
This statement runs without problem:
select tq84_ora_22905 from dual;
The following statement throws ORA-22905: cannot access rows from a non-nested table item:
select * from tq84_ora_22905();
Change the function so that is returns a nested table:
create type tq84_nt as table of tq84_t;
/
create or replace function tq84_ora_22905 return tq84_nt is begin return tq84_nt(tq84_t('x')); end;
/
Now, the statement runs ok:
select * from tq84_ora_22905();
Cleaning up:
drop type tq84_nt;
drop type tq84_t;
drop function tq84_ora_22905;