写一个存储过程,造一点测试数据
2016-07-28 17:14
211 查看
drop procedure if exists copy_task_proc;
/*
* 存储过程,将指定SQ执行totalCount次
*/
create procedure copy_task_proc(IN totalCount int)
begin
declare i int;
set i=0;
while i<totalCount do
-- 要执行的SQL语句
-- 复制当前表的数据,插入到当前表
insert into task_ta_tbl select uuid(), -- GUID函数
t.handle_type,t.match_sign,t.sender,t.t_receiver,t.faxNumber,t.flow_imp_id,t.status_id,t.read_tag,t.prev_hander,t.curr_hander,t.next_hander,t.sequence_no,t.subject,t.comments,t.priority,
now(), -- 当前时间函数
t.t_send_time,t.last_update_time,t.file_name,t.sign_flag,t.print_flag,t.e_mail,t.send_mark,t.traders,t.contract_time,t.lister,t.instruct_date from task_ta_tbl as t;
set i=i+1;
end while;
end;
-- 调用存储过程
call copy_task_proc(1);
-- 统计数据
-- select count(*) from task_ta_tbl;
/*
* 存储过程,将指定SQ执行totalCount次
*/
create procedure copy_task_proc(IN totalCount int)
begin
declare i int;
set i=0;
while i<totalCount do
-- 要执行的SQL语句
-- 复制当前表的数据,插入到当前表
insert into task_ta_tbl select uuid(), -- GUID函数
t.handle_type,t.match_sign,t.sender,t.t_receiver,t.faxNumber,t.flow_imp_id,t.status_id,t.read_tag,t.prev_hander,t.curr_hander,t.next_hander,t.sequence_no,t.subject,t.comments,t.priority,
now(), -- 当前时间函数
t.t_send_time,t.last_update_time,t.file_name,t.sign_flag,t.print_flag,t.e_mail,t.send_mark,t.traders,t.contract_time,t.lister,t.instruct_date from task_ta_tbl as t;
set i=i+1;
end while;
end;
-- 调用存储过程
call copy_task_proc(1);
-- 统计数据
-- select count(*) from task_ta_tbl;
相关文章推荐
- python的numpy模块安装问题
- python的numpy模块安装问题
- python的numpy模块安装问题
- python的numpy模块安装问题
- python的numpy模块安装问题
- python的numpy模块安装问题
- python的numpy模块安装问题
- python的numpy模块安装问题
- python的numpy模块安装问题
- Docker 与 PAAS
- python的numpy模块安装问题
- python的numpy模块安装问题
- 【bzoj2038】 小Z的袜子(hose)
- SQL四种语言:DDL,DML,DCL,TCL
- BeautifulSoup使用一两则(不定期补充)
- 谈谈C里面的指针之二【指针的加减法】
- Hive本地模式安装配置
- vector的push_back
- 朴素贝叶斯文档分类实验
- CentOS上开启MySQL远程访问权限