创建存储过程
create procedure 过程名([参数1,参数2,...])
BEGIN
SQL语句代码块
END
修改存储过程
ALTER PROCEDURE 存储过程名 SQL语句代码块
执行存储过程
call 过程名
([参数1,参数2,...])
删除存储过程
drop procedure [IF EXISTS] 过程名;
查看存储过程的状态
-
mysql> show procedure status like 'film_in_stock'\G
-
*************************** 1. row ***************************
-
Db: starive
-
Name: film_in_stock
-
Type: PROCEDURE
-
Definer: root@localhost
-
Modified: 2014-09-02 13:48:25
-
Created: 2014-09-02 13:48:25
-
Security_type: DEFINER
-
Comment:
-
character_set_client: utf8
-
collation_connection: utf8_general_ci
-
Database Collation: latin1_swedish_ci
-
1 row in set (0.02 sec)
查看存储过程的定义
-
show create procedure 函数名
通过查看information_schema.Routines了解存储过程和函数的信息
-
select *from routines where routine_name = 'film_in_stock' \G
-
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26435490/viewspace-1261981/
,如需转载,请注明出处,否则将追究法律责任。