Call another procedure with parameter : Call « Procedure Function « SQL / MySQL






Call another procedure with parameter

  
mysql>
mysql> delimiter $$
mysql>
mysql> CREATE PROCEDURE myProc(id int)
    -> BEGIN
    ->
    ->      SELECT 'in proc'+ id;
    -> END$$
Query OK, 0 rows affected (0.00 sec)

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

mysql>
mysql> delimiter ;
mysql>
mysql> call myProc1();
+---------------+
| 'in proc'+ id |
+---------------+
|             1 |
+---------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.02 sec)

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

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

mysql>

          
  








Related examples in the same category

1.Call another procedure
2.Call another procedure to pass the error code
3.Call another function
4.Nested function call
5.Call a Procedure