Re: SQL Function call does not fail on no_data_found ?
Date: Tue, 23 Mar 2010 18:16:23 +0100
Message-ID: <4ba8f766$0$6670$426a74cc_at_news.free.fr>
"webtourist" <webtourist_at_gmail.com> a écrit dans le message de news:
b2ae3703-61bc-480e-a8a9-c51e566aa11f_at_g11g2000yqe.googlegroups.com...
| 10gR2:
|
|
| given a function (in package "test") like this:
|
| FUNCTION get_ename (p_empno IN NUMBER) RETURN VARCHAR2 IS
| l_ename VARCHAR2(90);
| BEGIN
| SELECT ename INTO l_ename FROM emp WHERE empno = p_empno ;
| RETURN l_ename ;
| END ;
|
| And a SQL function calls:
|
| > select test.get_ename(7499) from dual;
|
| TEST.GET_ENAME(7499)
| ------------------------
| ALLEN
|
| > select test.get_ename(74992) from dual;
|
| TEST.GET_ENAME(74992)
| -----------------------
|
|
|
|
|
| I just realized the the above query wouldn't fail with "no_data_found"
| - has this always been like this behavior ?
Yes, no_data_found is trapped by SQL engine and converted to a NULL value.
Regards
Michel
Received on Tue Mar 23 2010 - 12:16:23 CDT