PLS-00372: In a procedure, RETURN statement cannot contain an expression

PLS-00372: In a procedure, RETURN statement cannot contain an expression

Oracle PL/SQL error message: PLS-00372: In a procedure, RETURN statement cannot contain an expression.

Cause:

In a procedure, a RETURN statement contains an expression, which is not allowed.

Solution:

Remove the expression from the RETURN statement, or redefine the procedure as a function.

Example:

DECLARE
    v_out VARCHAR2(50);
BEGIN
    v_out:='abc';
    return v_out;
END;

Output:

PLS-00372: In a procedure, RETURN statement cannot contain an expression




Correct

DECLARE
    v_out VARCHAR2(50);
BEGIN
    v_out:='abc';
    DBMS_OUTPUT.put_line(v_out); 
    return;
END;

Output:

abc

Oracle tutorial