PLS-00653: aggregate/table functions are not allowed in PL/SQL scope

Message:
PLS-00653: aggregate/table functions are not allowed in PL/SQL scope

Cause:
User tried to use a table/aggregate function in PL/SQL scope.

Action:
Do not use table/aggregate function in PL/SQL scope.

Explanation and Troubleshooting Tips:
Table functions and aggregate functions can only be referenced in an SQL query, not a PL/SQL statement.

When using a table function in a query, enclose it with the keyword TABLE().

If you need to assign the output of a table function to a PL/SQL collection, then you can do so by using BULK COLLECT in an SQL query.

Posted in Explained, PLS codes, Troubleshooting Tips

Contribute further information: