- 创建函数
CREATE FUNCTION sp_name ([func_parameter[,...]])
RETURNS type
[characteristic ...]
routine_body
characteristic:
LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'
- 创建存储过程
CREATE PROCEDURE sp_name ([proc_parameter[,...]])
[characteristic ...]
routine_body
characteristic:
LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'
- 修改函数
ALTER FUNCTION sp_name [characteristic ...]
characteristic:
{ CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'
- 修改存储过程
ALTER PROCEDURE sp_name [characteristic ...]
characteristic:
{ CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'
- 调用
CALL sp_name([parameter[,...]])
- 删除函数
DROP FUNCTION [IF EXISTS] sp_name
- 删除存储过程
DROP PROCEDURE [IF EXISTS] sp_name