当前位置:网站首页>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
调用存储过程
边栏推荐
- sublime text中conda环境中plt.show无法弹出显示图片的问题
- Visual implementation and inspection of visdom
- sublime text没关闭其他运行就使用CTRL+b运行另外的程序问题
- 电脑F1-F12用途
- 软件压力测试常见流程有哪些?专业出具软件测试报告公司分享
- Roguelike game into crack the hardest hit areas, how to break the bureau?
- egg. JS directory structure
- 有效提高软件产品质量,就找第三方软件测评机构
- Deep analysis of C language pointer
- pcd转ply后在meshlab无法打开,提示 Error details: Unespected eof
猜你喜欢
Problems in loading and saving pytorch trained models
同一局域网的手机和电脑相互访问,IIS设置
sublime text没关闭其他运行就使用CTRL+b运行另外的程序问题
Excellent software testers have these abilities
Synchronized solves problems caused by sharing
swagger设置字段required必填
Leetcode question brushing (5.28) hash table
TCP/IP协议
C語言雙指針——經典題型
【刷题】牛客网面试必刷TOP101
随机推荐
[cloud native topic -45]:kubesphere cloud Governance - Introduction and overall architecture of enterprise container platform based on kubernetes
JS inheritance method
[MySQL] lock
pytorch训练好的模型在加载和保存过程中的问题
swagger设置字段required必填
广州推进儿童友好城市建设,将探索学校周边200米设安全区域
Detailed explanation of heap sorting
[2022 Guangdong saim] Lagrange interpolation (multivariate function extreme value divide and conquer NTT)
2022.02.13 - NC001. Reverse linked list
2022.02.13 - NC003. Design LRU cache structure
China dihydrolaurenol market forecast and investment strategy report (2022 Edition)
Shift Operators
Leetcode question brushing (5.31) string
egg. JS getting started navigation: installation, use and learning
PLT in Matplotlib tight_ layout()
POI add write excel file
tree树的精准查询
Purpose of computer F1-F12
CISP-PTE实操练习讲解
sys.argv