Process 1: with return value: drop procedure if exists proc_addNum; create procedure proc_addNum (in x int, in y int, out sum int) BEGIN SET sum = x + y; end Then, execute the process and output the return value: call proc_addNum(2,3,@sum); select @sum; Procedure 2: Without return value: drop procedure if exists proc_addNum; create procedure proc_addNum (in x int, in y int) BEGIN DECLARE sum int; SET sum = x + y; SELECT sum; end Execution process: call proc_addNum(2,3); Summarize The above is the two ways of writing MySQL stored procedures with and without return values that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time! You may also be interested in:
|
>>: Steps for Docker to build its own local image repository
Since PHP7 came out, as a fan of the latest versi...
1: Differences in speed and loading methods The di...
During development, a good user interface will al...
Table of contents Preface How to implement Vuex f...
Table of contents A simple component example More...
Understand this Perhaps you have seen this in oth...
In the previous article [Detailed explanation of ...
Docker is really cool, especially because it'...
Preface The blogger uses the idea IDE. Because th...
Ubuntu does not allow root login by default, so t...
By default, the table title is horizontally cente...
I encountered a problem when I turned on my lapto...
Let's talk about the difference first last, t...
Preface When we forget the MySQL database passwor...
Tomcat7.0 sets virtual directory (1) Currently, o...