BTW, you can use "execute immediate" to the same effect.
On 9/7/20 3:47 PM, Mladen Gogala wrote:
Hi Dave,
It's a PL/SQL parser bug. Boh SQL*Developer and SQL*Plus report an error on thee "/" line, Here is the version that works:
SQL> create or replace function test_fn return integer as
2 vPercentage NUMBER;
3 cursor csr is select round(((select sum(vsize(ename)) from emp)/(SELECT SUM(bytes) FROM user_free_space WHERE tablespace_name = 'USERS')) *100, 2) from dual;
4 begin
5 open csr;
6 fetch csr into vPercentage;
7 close csr;
8 RETURN vPercentage;
9 END test_fn;
10 /
Function TEST_FN compiled
--
Mladen Gogala
/Database Consultant
Tel: (347) 321-1217/