SQL>
SQL> CREATE OR REPLACE FUNCTION no_return (check_in IN BOOLEAN)
2 RETURN VARCHAR2
3 AS
4 BEGIN
5 IF check_in
6 THEN
7 RETURN 'abc';
8 ELSE
9 DBMS_OUTPUT.put_line ('Here I am, here I stay');
10
11 IF check_in
12 THEN
13 RETURN 'def';
14 ELSIF SYSDATE IS NOT NULL
15 THEN
16 RETURN 'qrs';
17 ELSE
18 DBMS_OUTPUT.put_line ('Hello!');
19 END IF;
20 END IF;
21 END no_return;
22 /
SP2-0806: Function created with compilation warnings
SQL>
SQL> SHOW ERRORS FUNCTION no_return
Errors for FUNCTION NO_RETURN:
LINE/COL ERROR
-------- -----------------------------------------------------------------
1/1 PLW-05005: function NO_RETURN returns without value at line 21
SQL>
|