Skip to main content

RETURN

The RETURN statement terminates the execution of a stored function and returns the result to the caller.

The syntax of the RETURN statement is as follows:

RETURN expr

A stored function must contain at least one RETURN statement. If the function has multiple exit points, it may contain multiple RETURN statements.

Stored procedures and triggers do not use the RETURN statement. Instead, they use the LEAVE statement to exit the program.