Call another procedure : Call « Procedure Function « MySQL Tutorial






From the MySQL client, you use the CALL statement to execute a procedure, providing the procedure name and correct number of arguments.

CALL [database.]<procedure name> ([<parameter>, <parameter>, -]);
mysql>
mysql> delimiter $$
mysql>
mysql> CREATE PROCEDURE myProc()
    -> BEGIN
    ->
    ->      SELECT 'Alpha release of MySQL';
    -> END$$
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> CREATE PROCEDURE myProc1()
    -> BEGIN
    ->
    ->      call myProc();
    -> END$$
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> delimiter ;
mysql>
mysql>
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>
mysql> drop procedure myProc;
Query OK, 0 rows affected (0.02 sec)

mysql> drop procedure myProc1;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>








11.6.Call
11.6.1.CALL Statement Syntax
11.6.2.Call another procedure
11.6.3.Call another procedure with parameter
11.6.4.Call another procedure to pass the error code
11.6.5.Call another function
11.6.6.Nested function call