Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Can't use local function in select statement
Does anyone know why a local function can't be called in a select
statement.
Would work fine if you declared a separate function.
Connected to:
Oracle8i Enterprise Edition Release 8.1.6.2.0 - Production
With the Partitioning option
JServer Release 8.1.6.2.0 - Production
1 create or replace
2 PROCEDURE TEST (rc1 in out ep_refcur_pkg.rc)
3 IS 4 function l_is_numeric(a_str in varchar2) return varchar2 5 as 6 is_number number; 7 begin 8 is_number := a_str; 9 return 'YES'; 10 exception 11 when others then 12 return 'NO'; 13 end l_is_numeric; 14 begin 15 open rc1 for 16 select 17 l_is_numeric(dummy) 18 from dual;
SQL> show errors
Errors for PROCEDURE TEST:
LINE/COL ERROR
15/9 PL/SQL: SQL Statement ignored 16/9 PLS-00231: function 'L_IS_NUMERIC' may not be used in SQLSQL> Received on Tue Apr 03 2001 - 13:34:54 CDT