Lecture 67: The concept and use of stored functions in MySQL stored procedures

1. The concept of stored functions

Stored functions are very similar to stored procedures, except that the stored function must return a result every time it is called, and the parameters passed in by the stored function can only be of type IN.

Syntax structure for creating a stored function:

CREATE FUNCTION 存储函数名称(参数列表)
RETURNS 返回值的类型 存储函数的特性
BEGIN
	SQL逻辑;
	RETURN 变量;
END

RETURNS参数指的是声明返回值的数据类型,在MySQL8.

Guess you like

Origin blog.csdn.net/weixin_44953658/article/details/134240115