Stored Function Overview
A Stored Function is a set of SQL statements that can be called by name, accepts parameters, and returns a single value, enhancing SQL with custom logic.
Creating Stored Functions
DELIMITER //
CREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC
BEGIN
DECLARE x TINYINT;
SET x = 42;
RETURN x;
END
//
DELIMITER ;SELECT FortyTwo();
+------------+
| FortyTwo() |
+------------+
| 42 |
+------------+Stored Function Listings and Definitions
Dropping and Updating Stored Functions
Permissions in Stored Functions
See Also
Last updated
Was this helpful?

