// plain
A MariaDB stored procedure is a set of SQL statements that can be stored in the server. It can be used to encapsulate a set of operations or logic, which can then be called from multiple client programs.
CREATE PROCEDURE example_procedure()
BEGIN
SELECT * FROM table_name;
END;
Query OK, 0 rows affected (0.00 sec)
CREATE PROCEDURE example_procedure()
- This line creates a stored procedure namedexample_procedure
.BEGIN
- This line marks the beginning of the stored procedure.SELECT * FROM table_name;
- This line selects all the data from the table namedtable_name
.END;
- This line marks the end of the stored procedure.
onelinerhub: Mariadb procedure example