Javatpoint Logo
Javatpoint Logo

MySQL Procedure

Creating a procedure

In MySQL, a procedure can also be created. A procedure can return one or more than one value through parameters or may not return at all. The procedure can be used in SQL queries.

Syntax

Parameter

procedure_name: name of the procedure.

Parameter: number of parameters. It can be one or more than one.

declaration_section: all variables are declared.

executable_section: code for the function is written here.

Example 1

Table - 1

MySQL Procedure

Creating procedure:

MySQL Procedure

Calling procedure:

MySQL Procedure
MySQL Procedure

Drop a procedure

In MySQL, a procedure can also be dropped. When a procedure id dropped, it is removed from the database.

Syntax:

Parameter:

procedure_name: name of the procedure to be dropped.

Example 1:

MySQL Procedure
Next TopicMySQL Trigger




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA