RETURN statement (Return function return value)

Function

The RETURN statement returns a return value from a function.

Format

RETURN return-value
return-value::={value-expression|NULL}

Operands

Specifies a value expression or NULL as the return value.

Common rules

  1. A return value is converted to the data type that was specified in the RETURNS clause when the function was defined.
  2. The RETURN statement cannot be specified in a procedure.
  3. A subquery cannot be specified in a value expression that is specified in return-value.

Note

RETURN statements can be specified in an SQL function.