当前位置:网站首页>Navicat Premium 创建MySql 创建存储过程
Navicat Premium 创建MySql 创建存储过程
2022-07-06 08:41:00 【菜鸟驿站2020】
MySQL 存储过程是一些 SQL 语句的集合,比如有时候我们可能需要一大串的 SQL 语句,或者说在编写 SQL 语句的过程中需要设置一些变量的值,这个时候我们就完全有必要编写一个存储过程。
编写存储过程并不是件简单的事情,但是使用存储过程可以简化操作,且减少冗余的操作步骤,同时,还可以减少操作过程中的失误,提高效率,因此应该尽可能的学会使用存储过程。
使用 Navicat Premium 工具创建存储过程,新建查询,输入语句,最后点击【运行】

#存在同名的存储过程则删除
DROP PROCEDURE IF EXISTS my_test2;
#创建存储过程,定义名称和变量。**变量名与字段名不要一样,有时会出现莫名的问题**
CREATE PROCEDURE my_test2(in usern VARCHAR(20),in nick VARCHAR(20))
BEGIN
SELECT * FROM sys_user where username = usern and nickname = nick;
END
调用存储过程

边栏推荐
- [NVIDIA development board] FAQ (updated from time to time)
- sublime text中conda环境中plt.show无法弹出显示图片的问题
- C语言深度解剖——C语言关键字
- 根据csv文件某一列字符串中某个数字排序
- 生成器参数传入参数
- C language double pointer -- classic question type
- Rviz仿真时遇到机器人瞬间回到世界坐标原点的问题及可能原因
- Sublime text using ctrl+b to run another program without closing other runs
- 目标检测——Pytorch 利用mobilenet系列(v1,v2,v3)搭建yolov4目标检测平台
- Screenshot in win10 system, win+prtsc save location
猜你喜欢
![Verrouillage [MySQL]](/img/ce/9f8089da60d9b3a3f92a5e4eebfc13.png)
Verrouillage [MySQL]

Trying to use is on a network resource that is unavailable

JVM performance tuning and practical basic theory - Part 1

swagger设置字段required必填

JVM performance tuning and practical basic theory - Part 1

sublime text的编写程序时的Tab和空格缩进问题

MySQL learning record 10getting started with JDBC

C语言深度解剖——C语言关键字

TCP/IP协议

pytorch训练好的模型在加载和保存过程中的问题
随机推荐
View computer devices in LAN
延迟初始化和密封类
Unified ordering background interface product description Chinese garbled
What is CSRF (Cross Site Request Forgery)?
Chrome浏览器的crash问题
自动化测试框架有什么作用?上海专业第三方软件测试公司安利
C语言深度解剖——C语言关键字
【刷题】牛客网面试必刷TOP101
广州推进儿童友好城市建设,将探索学校周边200米设安全区域
Excellent software testers have these abilities
堆排序详解
PLT in Matplotlib tight_ layout()
China Light conveyor belt in-depth research and investment strategy report (2022 Edition)
After PCD is converted to ply, it cannot be opened in meshlab, prompting error details: ignored EOF
根据csv文件某一列字符串中某个数字排序
Fairguard game reinforcement: under the upsurge of game going to sea, game security is facing new challenges
sys.argv
How to conduct interface test? What are the precautions? Nanny level interpretation
[MySQL] database stored procedure and storage function clearance tutorial (full version)
2022.02.13 - 238. Maximum number of "balloons"