Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error: ORA-22905: cannot access rows from a non-nested table item

Dee102Feb 11 2021

When executing "select * from table(ReturnEmployees('exempt'));" it got this error
"ORA-22905: cannot access rows from a non-nested table item
22905. 00000 - "cannot access rows from a non-nested table item"
*Cause: attempt to access rows of an item whose type is not known at
parse time or that is not of a nested table type"
What do I do for the error? Thanks.
p.s. the select statement in the following function is pseudo code.
---------------------------------------------------------
FUNCTION ReturnEmployees(inEmpType in VARCHAR2) RETURN SYS_REFCURSOR IS
cur SYS_REFCURSOR;
BEGIN
OPEN cur FOR
select *
from Employee
where EmpType = inEmpType;
RETURN cur;
END;

Comments
Post Details
Added on Feb 11 2021
4 comments
3,587 views