当前位置:网站首页>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;
边栏推荐
- Hongmeng introduction and development environment construction
- 网络分层概念及基本知识
- Jetpack compose 1.1 release, based on kotlin's Android UI Toolkit
- Interpretation of Flink source code (I): Interpretation of streamgraph source code
- List set data removal (list.sublist.clear)
- 【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
- 05 personal R & D products and promotion - data synchronization tool
- C# WinForm中DataGridView单元格显示图片
- 信息与网络安全期末复习(完整版)
- Redis快速入门
猜你喜欢

JVM 垃圾回收器之Serial SerialOld ParNew

集成开发管理平台

微信防撤回是怎么实现的?

02个人研发的产品及推广-短信平台

04 products and promotion developed by individuals - data push tool

应用服务配置器(定时,数据库备份,文件备份,异地备份)

List set data removal (list.sublist.clear)

C# WinForm中DataGridView单元格显示图片

The problem of "syntax error" when uipath executes insert statement is solved

Grafana 9 is officially released, which is easier to use and more cool!
随机推荐
Remote code execution penetration test - B module test
[mmdetection] solves the installation problem
Jetpack compose 1.1 release, based on kotlin's Android UI Toolkit
How to submit data through post
04 products and promotion developed by individuals - data push tool
PostgreSQL 14.2, 13.6, 12.10, 11.15 and 10.20 releases
Vscode replaces commas, or specific characters with newlines
Akamai talking about risk control principles and Solutions
自动化运维利器ansible基础
Grafana 9 is officially released, which is easier to use and more cool!
[reverse] repair IAT and close ASLR after shelling
The solution to the left-right sliding conflict caused by nesting Baidu MapView in the fragment of viewpager
Xin'an Second Edition: Chapter 25 mobile application security requirements analysis and security protection engineering learning notes
EasyRE WriteUp
连接局域网MySql
JUnit unit test
关于Selenium启动Chrome浏览器闪退问题
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
BearPi-HM_ Nano development environment
Wu Jun's trilogy insight (V) refusing fake workers