当前位置:网站首页>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;
边栏推荐
- 轻量级计划服务工具研发与实践
- Garbage first of JVM garbage collector
- yarn : 无法加载文件 D:\ProgramFiles\nodejs\yarn.ps1,因为在此系统上禁止运行脚本
- BearPi-HM_ Nano development environment
- 沉淀下来的数据库操作类-C#版(SQL Server)
- Kali2021 installation and basic configuration
- Solr appears write Lock, solrexception: could not get leader props in the log
- C# NanoFramework 点灯和按键 之 ESP32
- [getting started with MySQL] fourth, explore operators in MySQL with Kiko
- How to submit data through post
猜你喜欢
Concept and basic knowledge of network layering
【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
Vscode matches and replaces the brackets
应用服务配置器(定时,数据库备份,文件备份,异地备份)
[getting started with MySQL] fourth, explore operators in MySQL with Kiko
pip install pyodbc : ERROR: Command errored out with exit status 1
About selenium starting Chrome browser flash back
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
JVM class loading subsystem
随机推荐
The art of Engineering (3): do not rely on each other between functions of code robustness
Vscode replaces commas, or specific characters with newlines
C # nanoframework lighting and key esp32
The solution to the left-right sliding conflict caused by nesting Baidu MapView in the fragment of viewpager
灵活报表v1.0(简单版)
自动化运维利器-Ansible-Playbook
Huawei certified cloud computing hica
Xin'an Second Edition: Chapter 12 network security audit technology principle and application learning notes
Redis installation on centos7
【Elastic】Elastic缺少xpack无法创建模板 unknown setting index.lifecycle.name index.lifecycle.rollover_alias
How does wechat prevent withdrawal come true?
[rapid environment construction] openharmony 10 minute tutorial (cub pie)
1. Introduction to JVM
[mmdetection] solves the installation problem
yarn : 无法加载文件 D:\ProgramFiles\nodejs\yarn.ps1,因为在此系统上禁止运行脚本
Application service configurator (regular, database backup, file backup, remote backup)
[reverse primary] Unique
TCP连接不止用TCP协议沟通
Flink parsing (IV): recovery mechanism
BearPi-HM_ Nano development board "flower protector" case