重新定義結束符號為 //
mysql>delimiter //
mysql>CREATE PROCEDURE simpleproc (OUT param1 INT)
->BEGIN
->SELECT COUNT(*) INTO param1 FROM t;
->END//
Query OK, 0 rows affected (0.00 sec) mysql>delimiter ;
mysql>CALL simpleproc(@a);
查詢
show procedure status;select `specific_name` from mysql.proc where db = 'your_db_name' and `type` = 'procedure';
select specific_name from mysql.proc;(當前資料庫)
select body from mysql.proc where specific_name ='procedure名稱';
show create procedure procedure名稱;
show create function function名稱;
drop procedure procedure名稱;(刪除)
drop procedure if exists procedure名稱;
沒有留言:
張貼留言