为了理解,让我们创建一个存储过程。在这里,我们在存储过程中有2条select语句-
DELIMITER // CREATE PROCEDURE select_statement() -> BEGIN -> SELECT "HI" AS `FIRST VALUE`; -> SELECT "HELLO" AS `SECOND VALUE`; -> END -> // DELIMITER ;
使用CALL命令调用存储过程-
CALL select_statement();
这将产生以下输出-
+-------------+ | FIRST VALUE | +-------------+ | HI | +-------------+ 1 row in set (0.00 sec) +--------------+ | SECOND VALUE | +--------------+ | HELLO | +--------------+ 1 row in set (0.01 sec)