Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Can't use local function in select statement

Can't use local function in select statement

From: Edward P. Robert <eprobert_at_javanet.com>
Date: Tue, 03 Apr 2001 14:34:54 -0400
Message-ID: <3ACA17CE.F20DF039@javanet.com>

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;

 19* end test;
SQL> / Warning: Procedure created with compilation errors.

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 SQL
SQL> Received on Tue Apr 03 2001 - 13:34:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US