当前位置:网站首页>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;
边栏推荐
- C# NanoFramework 点灯和按键 之 ESP32
- [reverse intermediate] eager to try
- connection reset by peer
- February database ranking: how long can Oracle remain the first?
- C version selenium operation chrome full screen mode display (F11)
- mysql高級(索引,視圖,存儲過程,函數,修改密碼)
- C#WinForm中的dataGridView滚动条定位
- Solrcloud related commands
- Akamai浅谈风控原理与解决方案
- 自动化运维利器ansible基础
猜你喜欢
Vscode matches and replaces the brackets
[introduction to MySQL] third, common data types in MySQL
04个人研发的产品及推广-数据推送工具
Grafana 9 is officially released, which is easier to use and more cool!
[elastic] elastic lacks xpack and cannot create template unknown setting index lifecycle. name index. lifecycle. rollover_ alias
[reverse intermediate] eager to try
案例:检查空字段【注解+反射+自定义异常】
信息与网络安全期末复习(基于老师给的重点)
02个人研发的产品及推广-短信平台
Models used in data warehouse modeling and layered introduction
随机推荐
Junit单元测试
07个人研发的产品及推广-人力资源信息管理系统
Based on infragistics Document. Excel export table class
The art of Engineering
Akamai浅谈风控原理与解决方案
Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
轻量级计划服务工具研发与实践
03个人研发的产品及推广-计划服务配置器V3.0
Flink analysis (II): analysis of backpressure mechanism
学 SQL 必须了解的 10 个高级概念
List set data removal (list.sublist.clear)
【逆向初级】独树一帜
Akamai anti confusion
2021-03-22 "display login screen during recovery" can't be canceled. The appearance of lock screen interface leads to the solution that the remotely connected virtual machine can't work normally
03 products and promotion developed by individuals - plan service configurator v3.0
网络分层概念及基本知识
Example of batch update statement combining update and inner join in SQL Server
案例:检查空字段【注解+反射+自定义异常】
About selenium starting Chrome browser flash back
connection reset by peer