MySQL快速插入大批量数据存储过程
- -- ----------------------------
- -- Table structure for `test`
- -- ----------------------------
- DROP TABLE IF EXISTS `test`;
- CREATE TABLE `test` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `ordernum` varchar(255) NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=500001 DEFAULT CHARSET=utf8;
-
-
- begin
- set @beginnum=1;
- set @endnum=500001;
-
- start transaction;
- while @beginnum < @endnum do
-
- set @v_beginnum=LPAD(@beginnum,7,0);
- set @order=concat(20121105,@v_beginnum);
-
- INSERT INTO test ( ordernum )
- VALUES
- (
- @order
- );
-
- set @beginnum=@beginnum+1;
- end while;
- commit;
- end
MySQL使用connector C/C+读取二进制字段Oracle 11g 监听文件日志过大 造成客户端无法连接相关资讯 MySQL数据库教程
- MySQL 处理非法数据 (04/09/2013 08:06:28)
- MySQL关于timestamp和mysqldump的 (12/16/2012 13:25:41)
- MySQL保证数据完整性 (12/16/2012 12:00:35)
| - ERROR 1130: mysql 1130连接错误的 (12/16/2012 13:29:08)
- MySQL数据库教程:管理数据库和表( (12/16/2012 12:47:02)
- MySQL使用connector C/C+读取二进 (11/05/2012 18:59:59)
|
本文评论 查看全部评论 (0)