当前位置:网站首页>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;
边栏推荐
- Models used in data warehouse modeling and layered introduction
- Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
- Wu Jun's trilogy insight (V) refusing fake workers
- Development and practice of lightweight planning service tools
- 信息与网络安全期末复习(完整版)
- MySQL basic addition, deletion, modification and query of SQL statements
- 04个人研发的产品及推广-数据推送工具
- DataGridView scroll bar positioning in C WinForm
- 【MySQL入门】第一话 · 初入“数据库”大陆
- 自动化运维利器ansible基础
猜你喜欢
Virtual machine startup prompt probing EDD (edd=off to disable) error
JVM class loading subsystem
PySpark算子处理空间数据全解析(5): 如何在PySpark里面使用空间运算接口
BearPi-HM_ Nano development board "flower protector" case
February database ranking: how long can Oracle remain the first?
[reverse intermediate] eager to try
03 products and promotion developed by individuals - plan service configurator v3.0
List set data removal (list.sublist.clear)
Display picture of DataGridView cell in C WinForm
Re signal writeup
随机推荐
List集合数据移除(List.subList.clear)
Xin'an Second Edition: Chapter 12 network security audit technology principle and application learning notes
Redis installation on centos7
Akamai浅谈风控原理与解决方案
网络分层概念及基本知识
Development and practice of lightweight planning service tools
Compile and build, from the bottom to the top
C#版Selenium操作Chrome全屏模式显示(F11)
Final review of information and network security (full version)
connection reset by peer
Total / statistics function of MySQL
MySQL报错解决
CTF逆向入门题——掷骰子
How uipath determines that an object is null
Pyspark operator processing spatial data full parsing (4): let's talk about spatial operations first
05个人研发的产品及推广-数据同步工具
【MMdetection】一文解决安装问题
Virtual machine startup prompt probing EDD (edd=off to disable) error
[rapid environment construction] openharmony 10 minute tutorial (cub pie)
Flink parsing (VII): time window