oracle生成几十万条测试数据,[数据库]Oracle中插入千万条测试数据

[数据库]Oracle中插入千万条测试数据

0 2018-10-09 12:00:23

测试需求,id、姓名、邮箱、手机号不可重复

1.创建序列create sequence id_sequence; //创建序列id_sequence

2.创建表create table USERINFO(ids number(11) NOT NULL,activity_name varchar(255) NOT NULL,intractive_type varchar(255) DEFAULT NULL NOT NULL,email varchar(255) NOT NULL,mobile int NOT NULL,userAgent varchar(255) NOT NULL,email_title varchar(255) NOT NULL,label varchar(255) NOT NULL,category1 varchar(255) NOT NULL,time date NOT NULL,time1 date NOT NULL,primary key(ids));

3.for循环插入数据declarei number;begin for i in 100..130 //100..130代表循环30次,按需求修改 loop insert into USERINFO values(id_sequence.nextval,'这是名字'||id_sequence.nextval,'现金',137||lpad(id_sequence.nextval,8,0)||'@qq.com',137||lpad(id_sequence.nextval,8,0),2,1,2,20,to_date('2018-09-29','yyyy-mm-dd'),to_date('2018-09-29','yyyy-mm-dd')); end loop; commit;end;

插入效果如下

bc91bb04e6e9c61e24c974e4440db8f2.gif 转载请保留本文网址:http://www.shaoqun.com/a/443101.html

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:[email protected]

oracle

0

你可能感兴趣的:(oracle生成几十万条测试数据,[数据库]Oracle中插入千万条测试数据)