Function Syntax
Create Function
sql
DELIMITER $$
CREATE OR REPLACE FUNCTION function_name(params) RETURNS [type]
[characteristic]
BEGIN
...
RETURN [value];
END
$$
DELIMITER;
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
A FUNCTION
must have at least one characteristic.
Name | Meaning |
---|---|
DETERMINISTIC | When parameters passed in are the same, always returns the same value |
READS SQL DATA | The function contains operation that reads table data |
MODIFIES SQL DATA | The function contains operation that modifies table data |