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
1. Check whether the existing nginx supports ipv6...
Nginx is configured with the same domain name, wh...
VNC is a remote desktop protocol. Follow the inst...
In the path of using nginx as a reverse proxy tom...
JS running trilogy js running code is divided int...
The test environment is set up with a mariadb 5.7...
1. Create a database authorization statement >...
Online shopping mall database-product category da...
Table of contents Preface Hello World image Set b...
Table of contents 1. Interface effect preview 2.u...
This article shares the specific code for the WeC...
Vue $set array collection object assignment In th...
Table of contents Problems with resource manageme...
The HTTP request methods specified by the HTTP/1....
Table of contents What is a trigger Create a trig...