In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to define parameters in MySql stored procedures. I hope you will gain something after reading this article. Let's discuss it together.
1. Parameter classification
Parameters, like stored procedures in MySql, can also take parameters. We do not use parameters in the previous example, but we will use parameters in the following example. Parameters of MySql are divided into three categories: IN, OUT, and INOUT, even literally these three types of parameters are easy to understand:
IN: this is the default type, that is, if the parameter does not specify a type, then the default is the IN type. This parameter is mainly the passed value, which is provided to the stored procedure. In addition, the changes made by the stored procedure will not affect the passed parameters.
OUT: this is mainly the value that the stored procedure passes out, that is, the stored procedure changes it to you and passes it back to the program that called it.
NOUT: the above two features are combined, that is, the value can be passed to the stored procedure, and the stored procedure can also change the value in passing to the program that calls it.
2. Parameter definition
The parameters are defined as follows:
MODE param_name param_type (param_size)
Where MODE can be IN, OUT, INOUT;param_name is the parameter name, and param_type is the type. Of course, it is important to note that the name cannot be the same as the field in the table.
After reading this article, I believe you have some understanding of "how to define parameters in MySql stored procedures". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.