当前位置:网站首页>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
调用存储过程
边栏推荐
- Double pointeur en langage C - - modèle classique
- logback1.3. X configuration details and Practice
- JVM performance tuning and practical basic theory - Part 1
- 电脑清理,删除的系统文件
- 如何有效地进行自动化测试?
- The network model established by torch is displayed by torch viz
- Restful API design specification
- On the inverse order problem of 01 knapsack problem in one-dimensional state
- 【ROS】usb_cam相机标定
- LDAP Application Section (4) Jenkins Access
猜你喜欢
Restful API design specification
pytorch训练好的模型在加载和保存过程中的问题
Mobile phones and computers on the same LAN access each other, IIS settings
【刷题】牛客网面试必刷TOP101
After PCD is converted to ply, it cannot be opened in meshlab, prompting error details: ignored EOF
Process of obtaining the electronic version of academic qualifications of xuexin.com
sublime text中conda环境中plt.show无法弹出显示图片的问题
sublime text没关闭其他运行就使用CTRL+b运行另外的程序问题
View computer devices in LAN
根据csv文件某一列字符串中某个数字排序
随机推荐
IOT -- interpreting the four tier architecture of the Internet of things
[brush questions] top101 must be brushed in the interview of niuke.com
MySQL learning record 10getting started with JDBC
Deep analysis of C language data storage in memory
C language double pointer -- classic question type
PC easy to use essential software (used)
How to conduct interface test? What are the precautions? Nanny level interpretation
Modify the video name from the name mapping relationship in the table
Function coritization
Sublime text using ctrl+b to run another program without closing other runs
After PCD is converted to ply, it cannot be opened in meshlab, prompting error details: ignored EOF
Pointer advanced --- pointer array, array pointer
Deep analysis of C language pointer
Shift Operators
VMware virtualization cluster
Report on Market Research and investment prospects of China's silver powder industry (2022 Edition)
Let the bullets fly for a while
visdom可视化实现与检查介绍
Image,cv2读取图片的numpy数组的转换和尺寸resize变化
【MySQL】锁