Omitting the RETURN statement in a function in PL/SQL V1 does not cause a problem at runtime. However, in versions after V1, this will cause a runtime error.
To preserve V1 behavior, the PL/SQL conversion utility adds a RETURN
statement with a NULL
argument to functions that are missing a
RETURN
statement.
Note: A missing RETURN
statement in a function will not generate a compiler error, but it will generate
a runtime error in versions after V1.
The conversion utility converts this PL/SQL V1 code:
FUNCTION noreturn (arg IN NUMBER) RETURN char IS BEGIN IF (arg > 100000) THEN TEXT_IO.PUT_LINE ('The point of no return.'); ENDIF;
RETURN statement is missingEND;
. . . to this:
FUNCTION noreturn (arg IN NUMBER) RETURN char IS BEGIN IF (arg > 100000) THEN TEXT_IO.PUT_LINE ('The point of no return.'); ENDIF; RETURN NULL;
RETURN NULL added by converterEND;
About the PL/SQL conversion utility
Copyright © 1984, 2005, Oracle. All rights reserved.