Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Exception inside function not being propagated to query
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