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


边栏推荐
- Implement Lmax disruptor queue from scratch (VI) analysis of the principle of disruptor solving pseudo sharing and consumers' elegant stopping
- [basic course of flight control development 8] crazy shell · open source formation uav-i2c (laser ranging)
- 【commons-lang3专题】003- RandomStringUtils 专题
- Anti shake and throttling
- 追踪伦敦银实时行情的方法有哪些?
- 【AD学习】本次海上航行器大赛画pcb图的历程
- DRF - deserialization of serializer, fields and parameters, local and global hooks, use of modelserializer
- Daniel guild Games: summary and future outlook of this year
- 【树莓派】widows电脑如何与树莓派连接
- day8
猜你喜欢

zabbix部署及监控

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

【AD学习】本次海上航行器大赛画pcb图的历程

Selenium docking agent and selenium wire access developer tool network

靠云业务独撑收入增长大梁,微软仍然被高估?

Summary of preprocessing methods for time series data
Depth first search (DFS) and its matlab code

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

JWT token related configuration (global configuration identity authentication rewrites authenticate method)

Download the latest version of visual studio code and connect to the server remotely (very detailed)
随机推荐
Educational Codeforces Round 132 (Rated for Div. 2)【A~C】
Asynchronous mode worker thread
UE4 调试常用的打印信息方法
数仓搭建——ADS层
Educational Codeforces Round 132 (Rated for Div. 2)【A~C】
Kwai focuses on regulating the number maintenance behavior in the ways of handling and manuscript washing, and how to purify the content ecology on the we media platform
Outlier detection and open set identification (2)
Techo hub Fuzhou Station dry goods attack | talk with developers about new industrial intelligence technology
Anti shake and throttling
[untitled]
16. Influence of deviation, variance, regularization and learning curve on the model
COPU陆首群教授应邀在开放原子全球开源峰会上做主旨演讲
🧐 table1 | 一秒搞定你的三线表
Some considerations about ThreadPool
Upload Excel files with El upload and download the returned files
17. Design of machine learning system
Several methods of multi-threaded sequential operation can be asked casually in the interview
execute immediate 简单示例合集(DML)
【Web开发】Flask框架基础知识
如何给女友讲明白JS的bind模拟实现