使用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 红包祝福语简短10字
18 周六早晨祝福语简短