PLS-00231:该函数可能无法在SQL中使用 [英] PLS-00231: Function may not be used in SQL
问题描述
我想在不创建包的情况下测试流水线函数.简化了以下示例:
I want to test my pipelined function without creating a package. The following example is simplified:
DECLARE
FUNCTION testDC RETURN NCOL PIPELINED IS
BEGIN
PIPE ROW(5);
END;
BEGIN
FOR cur IN (select * from table (testDC())) LOOP
dbms_output.put_line('--> ');
END LOOP;
END;
但是我得到这个错误:
ORA-06550:第7行,第7列:pls-00231:函数TESTDC不能在SQL中使用
ORA-06550:第7行,第7列:PL/SQL:ORA-00904 ::无效标识符
ORA-06550:第7行,第7列:PL/SQL:SQL语句已忽略
ORA-06550: line 7, column 7: pls-00231: function TESTDC may not be used in SQL
ORA-06550: line 7, column 7: PL/SQL: ORA-00904: : invalid identifier
ORA-06550: line 7, column 7: PL/SQL: SQL Statement ignored
测试这些功能的更好方法是什么?
What is better way to test these function?
推荐答案
将流水线函数创建为独立过程或程序包成员.然后,您可以从脚本中调用它.
Create your pipelined function as a standalone procedure or package member. Then you can call it from your script.
还要确保所引用的NCOL参数是在调用脚本可以访问的架构中声明的.
Also ensure that the NCOL parameter you refer to is declared in a schema that can be accessed by the calling script.
这篇关于PLS-00231:该函数可能无法在SQL中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!