문제

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top