当前位置:网站首页>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 查看效果


边栏推荐
- Summary of preprocessing methods for time series data
- 【commons-lang3专题】003- RandomStringUtils 专题
- Tips for API interface optimization
- ZABBIX deployment and monitoring
- day8
- 【commons-lang3专题】004- NumberUtils 专题
- Copu Professor Lu Shouqun was invited to give a keynote speech at the open atom global open source summit
- 自制 | 纯手工自制一个16位RISC架构CPU
- Upload Excel files with El upload and download the returned files
- armeabi-v7a架构(sv7a)
猜你喜欢

Api 接口优化的那些技巧

IMG tags prohibit dragging pictures

Yield Guild Games:这一年的总结与未来展望

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

Anomaly detection and unsupervised learning (2)

How to solve the problem that the Oracle instance cannot be started

小程序毕设作品之微信校园浴室预约小程序毕业设计成品(7)中期检查报告

DRF - web development mode, API interface, API interface testing tool, restful specification, serialization and deserialization, DRF installation and use

从零开始实现lmax-Disruptor队列(六)Disruptor 解决伪共享、消费者优雅停止实现原理解析

数仓搭建——ADS层
随机推荐
16. Influence of deviation, variance, regularization and learning curve on the model
[basic course of flight control development 8] crazy shell · open source formation uav-i2c (laser ranging)
Mock.js essay
追踪伦敦银实时行情的方法
Implement Lmax disruptor queue from scratch (VI) analysis of the principle of disruptor solving pseudo sharing and consumers' elegant stopping
armeabi-v7a架构(sv7a)
iNFTnews | 元宇宙购物体验将成为吸引消费者的一大利器
Huawei releases harmonyos 3.0, taking another step towards "Internet of all things"
Selenium docking agent and selenium wire access developer tool network
华为发布HarmonyOS 3.0,向“万物互联”再迈一步
flask结合容联云发送验证码
B- 树 ~
Asynchronous mode worker thread
Introduction of shortest path tree (SPT) and matlab code
用CDO进行nc数据的不规则裁剪
Have you seen the management area decoupling architecture? Can help customers solve big problems
Copu Professor Lu Shouqun was invited to give a keynote speech at the open atom global open source summit
返回*this的成员函数
17. Design of machine learning system
Techo hub Fuzhou Station dry goods attack | talk with developers about new industrial intelligence technology