Create, Delete, and Alter a Stored Procedure
This lesson covers the basics on creating, viewing, altering and removing a stored procedure.
We'll cover the following...
Create, Alter, and Delete a Stored Procedure
To create a stored procedure we use the CREATE PROCEDURE statement. CREATE PROCEDURE keywords are followed by the procedure name. We can also specify parameters to our procedure as a comma separated list withing parenthesis after the procedure name. The body of the stored procedure is enclosed with in the BEGIN and END keywords.
In order to delete a stored procedure, the ALTER ROUTINE privilege is a must. The DROP PROCEDURE statement deletes a stored procedure from the database. It can be used with the optional IF EXISTS clause.
Syntax
DELIMITER **
CREATE PROCEDURE procedure_name( parameter_list )
BEGIN ...