Home » SQL & PL/SQL » SQL & PL/SQL » Bulk insert dummy data into table (oracle 10g)
Bulk insert dummy data into table [message #598144] Thu, 10 October 2013 11:55 Go to next message
debasisp
Messages: 10
Registered: February 2010
Location: BANGALORE,INDIA
Junior Member
I have a table emp as mentioned below:

SELECT * FROM EMP_TEST;

EMP_TEST
-----------------------------------------------------
ENO EFIRSTNAME ESECONDNAME DEPTNO
1 JOHN PAI 10
2 ABC DEF 20
3 EFG GHI 30

Now the primary key in this above table is pk_emp_test_eno on eno.

I have a requirement where i need to dump some dummy data (600000000 numbers of data ) into the emp_test based on these existing data without disabling the constraints (maintaining unique constraint for each record). And while inserting i want to commit after every 1000 insertion.

Could you please help me in bulk inserting dummy datas into the table as it is taking much more time to insert into the same.

Regards,

Striker






Re: Bulk insert dummy data into table [message #598146 is a reply to message #598144] Thu, 10 October 2013 12:00 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
never do in PL?SQL that which can be done in plain SQL

why not just CREATE VIEW?
Why is any new table needed?

>And while inserting i want to commit after every 1000 insertion.
Above only make whole process SLOWER & increases the probability that ORA-01555 Snapshot Too Old error gets thrown

[Updated on: Thu, 10 October 2013 12:00]

Report message to a moderator

Re: Bulk insert dummy data into table [message #598147 is a reply to message #598146] Thu, 10 October 2013 12:07 Go to previous messageGo to next message
debasisp
Messages: 10
Registered: February 2010
Location: BANGALORE,INDIA
Junior Member
I dont want to create any view on my table. I want to insert dummy data on the existing table. Actually it is required to gather statistics for the same table. That is why we need to insert (6000000000) data into a table which is having just 1000 of records. This is only required to gather statistic. I used for loop to insert into the same but its taking lot of time.

Could you please guide?

Many thanks
Re: Bulk insert dummy data into table [message #598149 is a reply to message #598147] Thu, 10 October 2013 12:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
That is why we need to insert (6000000000) data into a table which is having just 1000 of records.


Do the opposite, insert the 1000 rows into the big table.

Re: Bulk insert dummy data into table [message #598151 is a reply to message #598149] Thu, 10 October 2013 12:44 Go to previous messageGo to next message
debasisp
Messages: 10
Registered: February 2010
Location: BANGALORE,INDIA
Junior Member
Thanks for the comments. Well the said comment has been already tried. My concern is that is taking much more time. Anyways thanks
Re: Bulk insert dummy data into table [message #598152 is a reply to message #598151] Thu, 10 October 2013 12:50 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
double 1000 rows 24 times & total exceeds 8,000,000,000
Previous Topic: Writing Turkey characters to text file
Next Topic: Creating views - percentages and multiple tables. Newbie
Goto Forum:
  


Current Time: Tue Apr 23 12:31:47 CDT 2024