Return from a procedure
Use the RETURN command to return data from a procedure.
RETURN [expression]
The procedure terminates and the value of expression is returned to the upper executor. If expression is not provided, NULL is assumed.
The return value of a procedure can be undefined. If control reaches the end of the top-level block of the procedure without encountering a RETURN statement, NULL is assumed. The result of the expression is automatically cast into the return type of the procedure as described for assignments.