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

RETURN Requires an Expression

In PL/SQL V1, you could use a RETURN statement without an expression to return a NULL value. Since all functions should return values, versions after V1 consider the RETURN statement mandatory. The conversion utility replaces all RETURN statements not followed by an expression with RETURN NULL.

If you compile existing code that includes a RETURN statement without an expression, this error message is generated:

ERROR 503: RETURN statement required for this return from function

Adding NULL to RETURN Example

The conversion utility converts this PL/SQL V1 code:

FUNCTION f RETURN NUMBER IS
 x NUMBER;
BEGIN
 x :=13;
 IF . . . THEN
  RETURN;
 END IF;
 RETURN x;
END;

. . . to this:

FUNCTION f RETURN NUMBER IS
 x NUMBER;
BEGIN
 x :=13;
 IF . . . THEN
  RETURN NULL; NULL added here
 END IF;
 RETURN x;
END;


About the PL/SQL V1 conversion utility