You need to do the ref cursor TYPE inside the package header rather than the body of your proc in order to make it externally available. Presumably you are trying to make the cursor available to something like e.g. a JDBC call, in which case you do not even have to loop it, just open the cursor.