RETURN expr
The RETURN
statement terminates execution of a stored function and returns the value expr
to the function caller. RETURN
语句终止存储函数的执行,并将值expr
返回给函数调用方。There must be at least one 存储函数中必须至少有一个RETURN
statement in a stored function. RETURN
语句。There may be more than one if the function has multiple exit points.如果函数有多个退出点,则可能有多个退出点。
This statement is not used in stored procedures, triggers, or events. 此语句不用于存储过程、触发器或事件。The LEAVE
statement can be used to exit a stored program of those types.LEAVE
语句可用于退出这些类型的存储程序。