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 inside function not being propagated to query

Exception inside function not being propagated to query

From: <bdg_at_hotmail.com>
Date: Wed, 10 Feb 1999 23:38:05 GMT
Message-ID: <79t58t$gem$1@nnrp1.dejanews.com>


I'm probably missing something simple here, but . . .

I have a function with the definition

FUNCTION test_function(p_value NUMBER) RETURN VARCHAR2 IS BEGIN
  IF p_value = 1 THEN
    RETURN 'Valid';
  ELSE
    RAISE NO_DATA_FOUND;
  END IF;
END; When called from a query, the function doesn't seem to be propagating the exception as I would expect it to. For example . . .


SQL> select test_function(1) from dual;

TEST_FUNCTION(1)


SQL> select test_function(2) from dual;

TEST_FUNCTION(2)



---

SQL>


The same results occur if the function is inside a package. I would prefer that the exception stop the query entirely. Any hints?

Thanks,
Brian Gastineau

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Feb 10 1999 - 17:38:05 CST

Original text of this message

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