mysql>
mysql> delimiter $$
mysql> CREATE PROCEDURE myProc()
-> BEGIN
->
-> DECLARE a INT;
-> DECLARE b VARCHAR(20);
-> DECLARE c INT;
->
-> SET a=99;
-> SET b="AAA";
-> SET c=CONCAT(a," ",b);
-> SELECT c;
-> END$$
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> delimiter ;
mysql>
mysql> call myProc();
+------+
| c |
+------+
| 99 |
+------+
1 row in set (0.00 sec)
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql>
mysql> drop procedure myProc;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
|