This issue might be met within these version range for DB.
The error might arise due to the compiling a pipelined function returning a PL/SQL table of my_cur%ROWTYPE
when the following situations met :
- the cursor[ or table]
my_cur
referenced in my_cur%ROWTYPE
is owned by a
different schema than the function
- there is another function in another schema having the same name as
the failing function
- this
other function
refers to the same cursor[ or table] as the failing function,
- this
other function
is either in the same schema as the cursor[ or table] or in a different one.
For a workaround, connect to sys [or system], and check out the objects with invalid status by
SQL> SELECT owner,object_name,status
FROM dba_objects
WHERE status = 'INVALID'
AND object_type = 'TYPE'
AND object_name LIKE 'SYS_PLSQL_%'
OWNER OBJECT_NAME STATUS
----- -------------------- --------
USER1 SYS_PLSQL_12345_2_1 INVALID
then compile the type returned
SQL> alter type USER1.SYS_PLSQL_12345_2_1 compile;
SQL> show error
might return PLS-00201 for another type such as
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
1/44 PLS-00201: identifier 'USER2.SYS_PLSQL_12346_7_1' must be declared
then grant the execute privilege to the owner of the invalid type
SQL> grant execute on USER2.SYS_PLSQL_12346_7_1 to USER1;
then recompile the invalid type
SQL> alter type USER1.SYS_PLSQL_12345_2_1 compile;
SQL> show error
and recheck out the objects with invalid status by the above query, if returns no row,
then the concerned package can safely be compiled
SQL> alter package USER1.mypackage compile;
Ref. Doc ID 1185303.1 from Oracle Support