想实现一个在向一个表里插入一条数据后,根据插入的数据,新建一张表
delimiter $$create trigger ceate_table
before insert on test
for each row
begin
create table new.tablename as select * from temptable where 1=2;
end $$delimiter ;
create会报错,想改成动态sql,但是MySQL的触发器不支持动态sql,所以有没有知道该怎样实现这个功能的?
delimiter $$create trigger ceate_table
before insert on test
for each row
begin
create table new.tablename as select * from temptable where 1=2;
end $$delimiter ;
create会报错,想改成动态sql,但是MySQL的触发器不支持动态sql,所以有没有知道该怎样实现这个功能的?
解决方案 »
- Parameter 'table_name' not found in the collection. C#中调用MySQL存储过程出错
- INNODB引擎启动不了,
- mysql求一个三个表的查询和计算排序
- mysql cluster中建表为什么不能建引擎是ndbcluster的?
- 为什么我在phpmyadmin上创建触发器总是抱错
- 如何将高版本的mysql数据转换为低版本的数据?小妹急切求助的!
- mysql訪問出錯.請指點.
- 如何把.mdb的所有表导入mysql?
- 求个sql
- select语句不能按照data为英文的字段进行查询
- BAT文件无法导出CSV
- 根据一个相同字段、时间提取另一表时间早于此时间最大的一条记录
在触发器使用