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
And, many times, maintenance requires your website...
Table of contents 1. Numeric Type 1.1 Classificat...
Installing Docker on CentOS requires the operatin...
Web page encoding is translated into English as we...
1.service command The service command actually go...
Table of contents Code cleaning "Frames"...
<br />Sometimes you may be asked questions l...
Case 1 vue-cli builds the vue3 project, uploads t...
1. Vue--The first vue-cli program The development...
1. Previous versions yum remove docker docker-cli...
The office needs Ubuntu system as the Linux devel...
Preface Due to the needs of the company's bus...
vsftpd Overview vsftpd is the abbreviation of &qu...
Here is a brief summary of the installation and c...
Table of contents Parsing .vue files Extract docu...