当前位置:网站首页>In / out / inout details of MySQL stored procedures
In / out / inout details of MySQL stored procedures
2022-06-13 00:35:00 【Flying husky】
IN

No matter how the parameters in the stored procedure are changed , Will not affect external variables .
OUT


No matter what is defined before the parameter is passed in , In the stored procedure, it is NULL.
Parameter changes in stored procedures , Will affect external variables .
INOUT


Parameters are defined externally , The defined variables will be passed into ( Feel similar Java Object address value ).
Parameter changes in stored procedures , Will affect external variables .
The following is the actual application
# If it already exists, delete
DROP PROCEDURE IF EXISTS getAreaCode;
# Create stored procedure pairs areaCode To deal with
DELIMITER $$
CREATE PROCEDURE getAreaCode(INOUT areaCode VARCHAR(12))
BEGIN
CASE
WHEN SUBSTR(areaCode, 3, 2) = '00' THEN SET areaCode = SUBSTR(areaCode, 1, 2);
WHEN SUBSTR(areaCode, 5, 2) = '00' THEN SET areaCode = SUBSTR(areaCode, 1, 4);
WHEN SUBSTR(areaCode, 7, 3) = '000' THEN SET areaCode = SUBSTR(areaCode, 1, 6);
WHEN SUBSTR(areaCode, 10, 3) = '000' THEN SET areaCode = SUBSTR(areaCode, 1, 9);
END CASE;
END $$
# Inner Mongolia , Hohhot, , New town
SET @areaCode = '150102000000';
CALL getAreaCode(@areaCode);
# Query the data under the new urban area
SELECT * FROM case_report WHERE case_area_code LIKE CONCAT(@areaCode,'%');边栏推荐
- [GXYCTF2019]禁止套娃--详解
- MAYA建模六
- Use of split() method in string class
- ucore lab1
- Maya modeling VI
- The e-commerce employee changed the product price to 10% off after leaving the company, and has been detained
- Test platform series (97) perfect the case part
- 2022美容师(技师)上岗证题目及答案
- ik分词器的安装
- Summary of openstack installation problems
猜你喜欢

睡前小故事之MySQL起源

Transaction creation of btcd transaction process (I)

Map from getting started to performance optimization
![[error] invalid use of incomplete type uses an undefined type](/img/8a/7cb5d270cfd8831ddc146687fe4499.png)
[error] invalid use of incomplete type uses an undefined type

On the parameters of main function in C language

Tsinghua Bosch joint ml center, thbi lab:cheng Yang Ying | realize safety reinforcement learning through the value at risk of constraints

RCC clock configuration of stm32f401

ik分词器的安装

Kali system -- dnsmap for DNS collection and analysis
![[GXYCTF2019]禁止套娃--详解](/img/c8/8c588ab8f58e2b38b9c64c4ccd733f.png)
[GXYCTF2019]禁止套娃--详解
随机推荐
VHDL programming experiment exercises collection
Penetration test summary
ucore lab3
Apispace empty number detection API interface is free and easy to use
硬(磁)盘(二)
Also on STM32 using dma+ serial port to obtain variable length data
[LeetCode]21. Merge two ordered linked lists twenty-nine
How to quickly query the online status of mobile phones
Converting Chinese numbers to Arabic numbers in Delphi
MySQL index
Stm32f4 development of DMA transmission to GPIO port
[LeetCode]1. Sum of two numbers thirty-four
Win10 home vs pro vs enterprise vs enterprise LTSC
June 13, 2022 Daily: Turing prize winner: what should we pay attention to if we want to succeed in our academic career?
Buuctf babyupload[gxyctf2019]
2022美容师(技师)上岗证题目及答案
[matlab] matrix operation
Successfully installed opencv under delphixe
6.824 Lab 4B: Sharded Key/Value Service
String类中split()方法的使用