【发布时间】:2017-03-20 19:46:00
【问题描述】:
我有一个这样的存储过程
create or replace procedure A is
procedure a1 is
......
end;
procedure a2 is
cursor c1 as
select a,b,(select f1(x,y) var_temp from dual)data from table_a; -- error here says
--Error: PLS-00231: function 'f1' may not be used in SQL
begin
......
end;
function f1(x varchar2,y varchar2) return varchar2 is
.....
end;
begin
....................
end;
我希望光标 c1 使用 f1 函数返回数据.. 但是它 说
错误:PLS-00231:函数 'f1' 不能在 SQL 中使用..
创建一个包可以解决这个问题,但我只能在一个过程中完成......
【问题讨论】:
-
嗨,GurV,我在程序之前定义了函数,即在我的情况下是在 p3 之前。我还尝试在 Cursor 之后在 P3 的声明部分中声明该函数。但同样的问题..
标签: sql oracle stored-procedures plsql stored-functions