MySQL 存储过程
来源:互联网 发布:vr全景制作软件 编辑:程序博客网 时间:2024/06/05 00:10
一、创建存储过程:
1.创建一个不带参数的存储过程
2.创建一个带输入参数( IN类型 )的存储过程
二、删除存储过程:
删除存储过程:drop procedure if exists sp_name();
1.创建一个不带参数的存储过程
create procedure sp1() beginselect version();end调用存储过程:CALL sp1();
2.创建一个带输入参数( IN类型 )的存储过程
create procedure removeUserById(IN id int unsigned) begindelete from user where u_id=id;end
调用存储过程:CALL removeUserById(3) ;
create procedure removeUserAndReturnUserNums(IN id int unsigned,OUT userNums int unsigned) begindelete from user where u_id=id;select count(*) from user into userNums;end调用存储过程:CALL removeUserAndReturnUserNums(5,@nums) ;
注:@nums代表变量,用来接收返回值
二、删除存储过程:
删除存储过程:drop procedure if exists sp_name();
0 0
- 【mysql】mysql存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- MySQL存储过程详解 mysql 存储过程
- WPF 简单数据绑定实例
- 区块链技术与CAP原理
- 同一台服务器部署多个tomcat时端口修改
- XMind思维导图教程——如何画好思维导图?(一)
- hdu1002
- MySQL 存储过程
- Python “属性(property)”详解
- iOS 实现毛玻璃效果
- wireshark使用及抓包分析(一)
- Win下Mysql5.6升级到5.7
- hdu 2563 统计问题
- IEnumerator、yield及unity3d协程的手动驱动与合并
- Windows 中配置TensorFlow(超级简单,两步即可)
- angularjs ng-click 传参数