Oracle's PLS-00231 error analysis, this error is usually caused by access to the function, declared in the header for the total function of the unanimous vote, then place in enclaves declared dying function causes an error.
create or replace function Two
create or replace procedure PrintTwo
select Two ()
The above functions and procedures, on the functions and procedures declared, call normal. Note that two functions are printtwo procedure call in the form of sql statement.
Error If this second program segments into a package, the function of private way, then compile the package body, reported pls-00231 error, function can not use it in class sql statement.
For what reason?
pl sql and sql for oracel, it is two different engines, engines, and thus for sql, plsql package of two private function, can not be found.
So the package use two functions in two ways:
1 declared in the function header declaration in two upcoming two functions make public declaration, then you can select two into mynum from dual; formal calls, of course, this can not hide the two functions.
2 to mynum: = two; invoked, since in this way to pl sql parsing engine, so it can be used normally in a private manner declared two functions.
Visible need a suitable manner to expose the two functions sql or plsql engine before use. So if the two make public statements, but with the package name .two invoked, not the same can be positioned to the two functions? Oh, of course not, you do not forget the two public statements in the package it is not visible outside anyway haha.
So a set of functions for the package type of return, such as: FUNCTION strsplit (p_list IN VARCHAR2, p_sep IN VARCHAR2 DEFAULT '|')
str_split a custom collection type:
TYPE "STR_SPLIT" IS TABLE OF VARCHAR2 (4000);
In this case, regardless of the type str_split statement in the package to public or private way, they were unable to properly use sql invoked, since the return of the collection, nor can plsql the kkk: = str_split invoked. In this case, it can only str_split defined as a custom data type oracle of:
create or replace TYPE "STR_SPLIT" IS TABLE OF VARCHAR2 (4000)
Then removed within the public or private packet type str_split defined, you can use sql calls the function.