当前位置:网站首页>MySQL split table DDL operation (stored procedure)
MySQL split table DDL operation (stored procedure)
2022-07-27 00:56:00 【everyD_ struggle】
The idea is to get the table name of the data , Then get the table name and modify it .
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=' database ' and table_name like ' Table people _%';
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 Field name 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();
边栏推荐
猜你喜欢

JSCORE day_04(7.5)
![[By Pass] 文件上传的绕过方式](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[By Pass] 文件上传的绕过方式

Doris或StarRocks Jmeter压测

Neo4j基础指南(安装,节点和关系数据导入,数据查询)

2022.7.14DAY604

Solve the problem that there is no ado.net entity data model in vs
![[WUSTCTF2020]CV Maker](/img/64/06023938e83acc832f06733b6c4d63.png)
[WUSTCTF2020]CV Maker

Valueerror: the device should not be 'GPU', since paddepaddle is not compiled with CUDA

Crop TIF image
Alibaba internal "shutter" core advanced notes~
随机推荐
mermaid
10个Web API
重学JSON.stringify
JSCORE day_ 04(7.5)
Crop TIF image
JS screen detection method summary 2021-10-05
MySQL Article 1
Essay - I say you are so cute
MySQL Part 2
Promise基本用法 20211130
Elaborate on the differences and usage of call, apply and bind 20211031
Spark数据倾斜解决办法
啊啊啊啊啊啊啊a
Designer mode
[b01lers2020]Welcome to Earth
[CISCN2019 华东南赛区]Double Secret
MYSQL数据库事务的隔离级别(详解)
[CISCN2019 华北赛区 Day1 Web2]ikun
2022.7.14DAY605
[CTF 真题] 2018-网鼎杯-Web-Unfinish