You cannot use functions in queries, if they have been declared in an anonymous block.
You need to CREATE
those functions, or better, but them into a package together (you also need to define them in the package header).
문제
I wonder if there is a way to do something like this.
declare
function a(apar in varchar2(1000)) return number;
function b(bpar in varchar2(1000)) return number
as
begin
-- something something something with the a() function
end b;
function a(apar in varchar2(1000)) return number
as
begin
-- something with the b(bpar in varchar2(1000)) function
end a;
select f from tbl where b(f) = 1;
end
This is a recursion I use to check if I need to show a row from a select. And I want to do this in anonymous block, but oracle tells me that I'm wrong:
ORA-06550 : the b function cannot be used...
How to overcome this ?
해결책
You cannot use functions in queries, if they have been declared in an anonymous block.
You need to CREATE
those functions, or better, but them into a package together (you also need to define them in the package header).