使用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 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短