mariadbMariadb procedure example
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.
Example code
CREATE PROCEDURE example_procedure()
BEGIN
SELECT * FROM table_name;
END;
Output example
Query OK, 0 rows affected (0.00 sec)
Code explanation
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.
Helpful links
More of Mariadb
- What type to use for a year in Mariadb?
- How to use UUID in Mariadb?
- How to install Mariadb on Ubuntu?
- How to work with XML in Mariadb?
- How to get current year in Mariadb?
- How to check version of Mariadb?
- How to use xtrabackup in Mariadb?
- How to use window functions in Mariadb?
- How to use variables in Mariadb?
- Mariadb partitioning example
See more codes...