MySQL_Shell_清空数据库表中的数据
来源:互联网 发布:mysql的好处 编辑:程序博客网 时间:2024/04/30 11:28
今天博主写了一个删除数据库数据的存储过程,如下所示:
drop procedure if exists del_all_tb;delimiter $$create procedure del_all_tb(db char(20))begin declare done int default 0; declare tb char(100); declare cur cursor for select table_name from infoRmation_schema.tables where table_schema = db; declare continue handler for not found set done = 1; open cur; repeat fetch cur into tb; set @sql := concat("truncate ", tb, ";"); prepare stmt from @sql; execute stmt; deallocate prepare stmt; until done end repeat; close cur;end $$delimiter ;call del_all_tb("数据库名");drop procedure if exists del_all_tb;
0 0
- MySQL_Shell_清空数据库表中的数据
- 自动清空数据库中的数据
- 清空数据库中的所有数据
- 清空数据库所有表数据
- 【SQLSERVER】清空数据库所有表数据
- 清空数据库表
- 清空datagridview中的数据
- 清空数据库里所有的表的数据
- 清空数据库中所有表的数据
- SQL 清空数据库的所有表数据
- 使用SQL语句清空数据库所有表的数据
- 清空数据库中所有表数据的方法
- 清空数据库中所有表数据的简洁方法
- 清空数据库中所有表的数据
- 使用SQL语句清空数据库所有表的数据
- 清空数据库中所有表数据的方法
- 使用SQL语句清空数据库所有表的数据
- 使用SQL语句清空数据库所有表的数据
- 《图说VR入门》——Unity插件DK2使用教程
- 网络流(最小割最大流)【POJ3308】
- 通过Python3.5来学习几种不同的IO模型
- S32V234专业级AVM全景+ADAS解决方案
- 如何打造一个让人愉快的框架
- MySQL_Shell_清空数据库表中的数据
- Web基础之Maven包冲突
- NTP服务及时间同步(CentOS6.x)
- android opengl es入门示例
- LeaveCriticalSection问题的解决方案
- leetcode 406- Queue Reconstruction by Height 贪心算法的应用
- ICPC 2016 DALIAN H To begin or not to begin
- 使用VisualStudio2013编译ffmpeg3.1全过程
- 欢迎使用CSDN-markdown编辑器