当前位置:网站首页>mysql存储过程 实现创建一张表(复制原表的结构新建的表)
mysql存储过程 实现创建一张表(复制原表的结构新建的表)
2022-07-28 23:38:00 【健康平安的活着】
一 存储过程代码
1.1 存储过程
drop PROCEDURE if EXISTS p_create_table4;
CREATE DEFINER=`root`@`%` PROCEDURE `p_create_table4`(
IN pa_table_name VARCHAR (30) # 表名
)
BEGIN
# 利用concat拼接字符串函数,将复制表的sql赋值到变量sql_create_table
set @sql_create_table = concat('CREATE TABLE ',pa_table_name,' like ','iip_acc_warn_information');
# 预处理建表
PREPARE sql_create_table FROM @sql_create_table;
# 执行sql
EXECUTE sql_create_table;
END1.2 调用过程
call p_create_table4("iip_acc_warn_information_8910");
1.3 查看效果


边栏推荐
猜你喜欢
![[Yugong series] go teaching course in July 2022, an array of 020 go containers](/img/06/b2f69599b30c4a93a6240613cbee84.png)
[Yugong series] go teaching course in July 2022, an array of 020 go containers

管理区解耦架构见过吗?能帮客户搞定大难题的

Relying on cloud business to support revenue growth alone, is Microsoft still overvalued?

Educational Codeforces Round 132 (Rated for Div. 2)【A~C】

Anomaly detection and unsupervised learning (2)

selenium对接代理与seleniumwire访问开发者工具NetWork

浅谈一下跨端技术方案

Summary of preprocessing methods for time series data

第二轮1000个Okaleido Tiger,再次登录Binance NFT 1小时售罄

Copy the table in word to wechat as a picture and send it
随机推荐
【无标题】
Meeting notification & meeting feedback & feedback details function of meeting OA project
There is a span tag. If you want to do click events on it, how can you expand the click area
Implement Lmax disruptor queue from scratch (VI) analysis of the principle of disruptor solving pseudo sharing and consumers' elegant stopping
Error reporting: the network preview shows {xxx:['this field is required']}
selenium对接代理与seleniumwire访问开发者工具NetWork
【commons-lang3专题】002- RandomUtils 专题
Educational Codeforces Round 132 (Rated for Div. 2)【A~C】
Flash and seven cattle cloud upload pictures
What opportunities does the London gold real-time market bring?
云函数实现网站自动化签到配置详解【Web函数/Nodejs/cookie】
Method of converting inline elements to block elements
CUDA related
day8
Huawei releases harmonyos 3.0, taking another step towards "Internet of all things"
Execute immediate simple sample set (DML)
The method of tracking the real-time market of London Silver
【commons-lang3专题】003- RandomStringUtils 专题
Api 接口优化的那些技巧
Implement Lmax disruptor queue from scratch (VI) analysis of the principle of disruptor solving pseudo sharing and consumers' elegant stopping