当前位置:网站首页>MYSQL分表DDL操作(存储过程)
MYSQL分表DDL操作(存储过程)
2022-07-26 22:39:00 【everyD_struggle】
思路是获取数据的表名,然后拿到表名进行修改。
drop procedure if exists useCursor;
CREATE PROCEDURE useCursor()
BEGIN
DECLARE oneAddr varchar(36) default '';
DECLARE allAddr varchar(40) default '';
DECLARE done INT DEFAULT 0;
DECLARE curl CURSOR FOR select table_name from information_schema.tables where table_schema='数据库' and table_name like '表民_%';
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN curl;
REPEAT
FETCH curl INTO oneAddr;
IF not done THEN
set @sql=concat('alter table ',oneAddr," add 字段名 VARCHAR(32) NOT NUll DEFAULT '' COMMENT 'xxx'; ");
PREPARE stmt from @sql;
execute stmt;
END IF;
UNTIL done END REPEAT;
select allAddr;
CLOSE curl;
END;
call useCursor();
边栏推荐
- [NPUCTF2020]ezinclude
- [CISCN2019 华北赛区 Day1 Web2]ikun
- Search engine realizes keyword highlighting
- DOM day_ 04 (7.12) BOM, open new page (delayed opening), address bar operation, browser information reading, historical operation
- Apply with new, delete and malloc, free to free the heap space
- JSCORE day_04(7.5)
- [4.4 detailed explanation of fast power and inverse element of fast power]
- JSCORE day_ 02(7.1)
- Use csrftester to automatically detect CSRF vulnerabilities
- JSCORE day_ 01(6.30) RegExp 、 Function
猜你喜欢

JSCORE day_01(6.30) RegExp 、 Function

DOM day_01(7.7) dom的介绍和核心操作

Parallel MPI program delivery send message
![[b01lers2020]Welcome to Earth](/img/e7/c8c0427b95022fbdf7bf2128c469c0.png)
[b01lers2020]Welcome to Earth

el-checkbox中的checked勾选状态问题 2021-08-02

关于Redis问题的二三事

DOM day_04(7.12)BOM、打开新页面(延迟打开)、地址栏操作、浏览器信息读取、历史操作
![[WUSTCTF2020]CV Maker](/img/64/06023938e83acc832f06733b6c4d63.png)
[WUSTCTF2020]CV Maker

6_ Gradient descent method

Inherit, inherit, inherit
随机推荐
[SQL注入] 报错注入
Detailed explanation of arrow function 2021-04-30
Mysql常用函数(汇总)
ArcGIS and CASS realize elevation points of cross-section Exhibition
Looking for the real murderer
Programmers must do 50 questions
MySQL common functions (summary)
JSCORE day_05(7.6)
JSCORE day_ 04(7.5)
关于Thymeleaf的表达式
DOM day_03(7.11) 事件冒泡机制、事件委托、待办事项、阻止默认事件、鼠标坐标、页面滚动事件、创建DOM元素、DOM封装操作
[SQL注入] 联合查询
Ah ah ah ah ah a
[SQL注入] 扩展注入手法
[hongminggu CTF 2021] write_ shell
[ciscn2019 North China Day1 web5] cyberpunk
07 - 日志服务器的搭建与攻击
2022.7.9DAY601
【3. 基础搜索与图论初识】
[qt] meta object system