使用INT和VARCHAR值调用的MySQL存储过程
要调用存储过程,可以使用CALL命令。以下是语法-
CALL yourStoredProcedureName(parameter if any);
让我们首先创建一个示例过程。以下是创建存储过程的查询。在这里,我们设置了两个值,一个是INT,另一个是VARCHAR-
mysql> DELIMITER //
mysql> CREATE PROCEDURE CALL_PROC(Id int,Name varchar(40))
BEGIN
SELECT CONCAT('You have entered the Id which is=',Id);
SELECT CONCAT('You have entered the Name which is=',Name);
END
//
mysql> DELIMITER ;以下是在MySQL中调用存储过程的查询-
mysql> CALL CALL_PROC(1001,'Chris');
这将产生以下输出-
+------------------------------------------------+
| CONCAT('You have entered the Id which is=',Id) |
+------------------------------------------------+
| You have entered the Id which is=1001 |
+------------------------------------------------+
1 row in set (0.00 sec)
+----------------------------------------------------+
| CONCAT('You have entered the Name which is=',Name) |
+----------------------------------------------------+
| You have entered the Name which is=Chris |
+----------------------------------------------------+
1 row in set (0.02 sec)热门推荐
10 诗词送行祝福语大全简短
11 新房开工吉日祝福语简短
12 50多岁生日简短祝福语
13 安徽疫情祝福语简短英语
14 农民朋友发财祝福语简短
15 对生活祝福语简短精辟
16 搬家词简短祝福语朋友
17 女神结婚快乐祝福语简短
18 文学短句祝福语大全简短