mysql中call语句的例子,调用另一个存储过程。
代码如下:
mysql> delimiter $$ mysql> CREATE PROCEDURE myProc() //创建存储过程 -> BEGIN -> -> SELECT 'Alpha release of MySQL'; -> END$$ Query OK, 0 rows affected (0.00 sec) mysql> CREATE PROCEDURE myProc1() //创建存储过程 -> BEGIN -> -> call myProc(); -> END$$ Query OK, 0 rows affected (0.00 sec) mysql> delimiter ; mysql> call myProc1(); //调用存储过程 +------------------------+ | Alpha release of MySQL | +------------------------+ | Alpha release of MySQL | +------------------------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.00 sec) mysql> drop procedure myProc; //删除存储过程 Query OK, 0 rows affected (0.02 sec) mysql> drop procedure myProc1; //删除存储过程 Query OK, 0 rows affected (0.00 sec)