当前位置:网站首页>MySQL stored procedure
MySQL stored procedure
2022-07-06 17:40:00 【Bald Second Senior brother】
Catalog
What are stored procedures for ?
stored procedure
What are stored procedures for ?
Stored procedures and functions are compiled in advance and stored in a database SQL Collection of statements , Calling stored procedures and functions can simplify a lot of work for application developers , Reduce data transfer between database and application server , It's good for improving the efficiency of data processing .
The difference between stored procedures and functions :
Stored procedures have no return value , Functions have return values
Creation of stored procedures
Define separator :
Why define delimiters , because mysql The default separator in is ; Then use enter to execute this command , But sometimes we need to define a separator without executing commands .
delimiter $
Restore separator
delimiter ;
Create stored procedure
create procedure pro_test1() -> begin -> select 'hello word'; -> end$
Calling stored procedure
call pro_test1();
Stored procedure query
1. Query all stored procedures in the database
select name from mysql.proc where db='test';
among test Name the database
2. Querying the status of stored procedures
show procedure status;
3. View the definition of the specified stored procedure
show create procedure pro_test1;
Delete stored procedure
drop procedure pro_test1;
边栏推荐
- BearPi-HM_ Nano development environment
- Redis快速入门
- 【MySQL入门】第三话 · MySQL中常见的数据类型
- Garbage first of JVM garbage collector
- 信息与网络安全期末复习(基于老师给的重点)
- PostgreSQL 14.2, 13.6, 12.10, 11.15 and 10.20 releases
- 【逆向初级】独树一帜
- Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
- Flink parsing (VII): time window
- Development and practice of lightweight planning service tools
猜你喜欢
05 personal R & D products and promotion - data synchronization tool
Deploy flask project based on LNMP
PySpark算子处理空间数据全解析(4): 先说说空间运算
轻量级计划服务工具研发与实践
Pyspark operator processing spatial data full parsing (4): let's talk about spatial operations first
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
学 SQL 必须了解的 10 个高级概念
PySpark算子处理空间数据全解析(5): 如何在PySpark里面使用空间运算接口
06个人研发的产品及推广-代码统计工具
Akamai talking about risk control principles and Solutions
随机推荐
Final review of information and network security (full version)
PySpark算子处理空间数据全解析(5): 如何在PySpark里面使用空间运算接口
CentOS7上Redis安装
February database ranking: how long can Oracle remain the first?
MySQL advanced (index, view, stored procedure, function, password modification)
[CISCN 2021 华南赛区]rsa Writeup
Grafana 9 正式发布,更易用,更酷炫了!
基于LNMP部署flask项目
02个人研发的产品及推广-短信平台
EasyRE WriteUp
信息与网络安全期末复习(完整版)
PySpark算子处理空间数据全解析(4): 先说说空间运算
Interpretation of Flink source code (II): Interpretation of jobgraph source code
复盘网鼎杯Re-Signal Writeup
Integrated development management platform
About selenium starting Chrome browser flash back
1. Introduction to JVM
Flink parsing (III): memory management
connection reset by peer
Wu Jun's trilogy experience (VII) the essence of Commerce