Home Procedure Syntax

CREATE PROCEDURE and CREATE FUNCTION Syntax

Here is the formal syntax for creating a Stored Procedure and Stored Function. Its been my experience to briefly review the formal syntax when searching for help on a topic then immediately looking for good examples to reference.


CREATE [DEFINER = { user | CURRENT_USER }]
PROCEDURE sp_name ([proc_parameter[,...]])
[characteristic ...] routine_body
CREATE
[DEFINER = { user | CURRENT_USER }]
FUNCTION sp_name ([func_parameter[,...]])
RETURNS type
[characteristic ...] routine_body
proc_parameter:
[ IN | OUT | INOUT ] param_name type
func_parameter:
param_name type
type:
Any valid MySQL data type
characteristic:
LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'
routine_body:
Valid SQL procedure statement

Last Updated ( Tuesday, 04 August 2009 15:00 )

Who's Online
We have 8 guests online