Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the purpose of the call statement

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what the function of the call sentence is. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

The CALL statement can return a value to its caller with a parameter declared as an OUT or INOUT parameter.

It also "returns" the number of affected rows, which the client program can obtain at the SQL level by calling the ROW_COUNT () function, which is obtained from C by calling the the mysql_affected_rows () C API function. (recommended study: MySQL video tutorial)

Syntax considerations:

The semicolon ";" is added at the end of every statement in the MySQL stored procedure. Declare c int; if an is null then set a = 0; end if;... end;2, the comment is -; the parameter of the MySQL stored procedure cannot specify the default value of 3, and the "return" keyword cannot be used in the MySQL stored procedure. Set c = a + b; select c as sum; end;4. When calling a MySQL stored procedure, you need to add "()" to the procedure name. Even if you don't have a parameter, you need "()" call pr_no_param (); 5. Because MySQL stored procedure parameters have no default values, parameters cannot be omitted when calling MySQL stored procedures. You can use null instead. Call pr_add (10, null); on the role of the call statement is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report