
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What are the different modes of parameters used by MySQL stored procedure?
Parameters make the stored procedure more useful and flexible. In MySQL, we have the following three kinds of modes −
IN mode
It is the default mode. When we define an IN parameter in a stored procedure, the calling program has to pass an argument to the stored procedure. The value of an IN parameter is protected which means that even the value of the IN parameter is changed inside the stored procedure; its original value is retained after the stored procedure ends.
OUT mode
The value of an OUT parameter can be changed inside the stored procedure and its new value is passed back to the calling program. It is to be noticed that the stored procedure cannot access the initial value of the OUT parameter when it starts.
INOUT mode
An INOUT parameter is the combination of IN and OUT parameters which means that the calling program may pass the argument, and the stored procedure can modify the INOUT parameter and pass the new value back to the calling program.
Syntax for defining a parameter
Following is the syntax of defining a parameter in the stored procedure −
MODE parameter_name parameter_type(parameter_size)
Here, MODE can be IN, OUT or INOUT which depends upon the purpose of the parameter in the stored purpose.
- Parameter_name is the name of the parameter.
- Parameter_type is the data type of parameter.
- Parameter_size is the size of the parameter
- Related Articles
- What are the different modes of nutrition?
- MySQL stored procedure parameters don't seem to work with special character @?
- What do you mean by Scope of variables inside MySQL stored procedure?
- How can local variables be used in MySQL stored procedure?
- How can user variables be used in MySQL stored procedure?
- How Can MySQL CASE statement be used in stored procedure?
- What is the usage of “@” symbol in MySQL stored procedure?
- What are the prerequisites for starting writing and using MySQL stored procedure?
- How can a MySQL stored procedure call another MySQL stored procedure inside it?
- Display description of MySQL stored procedure
- How MySQL IF statement can be used in a stored procedure?
- How MySQL WHILE loop statement can be used in stored procedure?
- How MySQL REPEAT loop statement can be used in stored procedure?
- How Can MySQL LOOP statement be used in a stored procedure?
- What are the different time format characters used by MySQL DATE_FORMAT() function?
