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

Home -> Community -> Usenet -> c.d.o.server -> Exception in In-Line Function

Exception in In-Line Function

From: klabu <klabu_at_internet.com>
Date: Wed, 29 Nov 2006 15:25:58 -0500
Message-ID: <12mrr6q63rk2g4e@corp.supernews.com>


This inline function is supposed to error out (no_data_found) what is wrong ?
How do I make the SELECT error out ?
thanks
(10gR2)

SQL> CREATE OR REPLACE
  2 FUNCTION blah(p_a IN NUMBER) RETURN VARCHAR2   3 IS
  4 l_return VARCHAR2(30);
  5 BEGIN

  6      SELECT 'x' || to_char(p_a) INTO l_return
  7        FROM dual WHERE 1 = 0;
  8      RETURN l_return;
  9    EXCEPTION
 10      WHEN no_data_found THEN
 11           RAISE ;

 12 END;
 13 /

Function created.

Elapsed: 00:00:00.13
rchin_at_DEV10> select blah('124578') from dual;

BLAH('124578')


1 row selected. Received on Wed Nov 29 2006 - 14:25:58 CST

Original text of this message

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