A script-enabled browser is required for this page to function properly.

PL/SQL conversion utility: Missing RETURN statement in function causes runtime error

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.

Example

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 missing
END;

. . . 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 converter
END;

See also

About the PL/SQL conversion utility