i want to insert one million record in oracle DB table. i have achieved similar task in mysql using cross join as follows :
1) insert 10 records first.
insert into spltest_sampleapl2 values (10001, 'aaaa');
insert into spltest_sampleapl2 values (10002, 'bbbbb');
insert into spltest_sampleapl2 values (10003, 'ccccc');
insert into spltest_sampleapl2 values (10004, 'dddddd');
insert into spltest_sampleapl2 values (10005, 'eeeeeeeee');
insert into spltest_sampleapl2 values (10006, 'ffffff');
insert into spltest_sampleapl2 values (10007, 'gggggggg');
insert into spltest_sampleapl2 values (10008, 'hhhhhh');
insert into spltest_sampleapl2 values (10009, 'iiiiii');
insert into spltest_sampleapl2 values (10010, 'jjjjjj');
commit;
2) using user-variable
set @num := 10010;
3) insert records with single-join
insert into apl2 (id, data) select (@num := @num + 1) ,s1.data from apl2 s1, apl2 s2, apl2 s3, apl2 s4,apl2 s5, apl2 s6;
commit;
Now i want to do the same on similar schema in Oracle. How to do it ?
First i inserted record having id from 1000000 to 1000010 (10 records), then i used following command.
insert into apl2(id, data) select rownum ,s1.data from apl2 s1, apl2 s2, apl2 s3, apl2 s4, apl2 s5, apl2 s6 where rownum < 1000001;