Home » SQL & PL/SQL » SQL & PL/SQL » Can we write two "Insert into.." on a single table (Oracle 9i)
Can we write two "Insert into.." on a single table [message #336468] Sun, 27 July 2008 09:47 Go to next message
victory_nag
Messages: 36
Registered: June 2008
Location: CA
Member
Hello,
I have to load a million records into my target table. There are roughly around 20 source tables from which I have to extract data as per the requirements. For this I am using Bulk insert to quicken the process.
So the doubt here is
"Can I use multiple Insert statements on a single target table?"
Suppose If I have to insert 10 million records in my target table then can I use the like shown below

Insert into TableA 
Select * from Src_tbl Where Id between 1 to 500000;
Insert into TableA
Select * from Src_tbl where Id between 500000 to 1000000;


Both these Insert statements shoot parallely?
I mean ProcedureA has Insert statement ranging from 1 to .5 Million
and ProcedureB has insert statement ranging from .5 to 1 million
and both these procedures are called parallely?

Can you anyone of you clear this doubt please.
Re: Can we write two "Insert into.." on a single table [message #336469 is a reply to message #336468] Sun, 27 July 2008 09:53 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>Both these Insert statements shoot parallely?
Only in different sessions.
Re: Can we write two "Insert into.." on a single table [message #336473 is a reply to message #336468] Sun, 27 July 2008 10:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Both these Insert statements shoot parallely?

Use ONE insert with parallel hint.

Regards
Michel
Re: Can we write two "Insert into.." on a single table [message #336634 is a reply to message #336468] Mon, 28 July 2008 08:16 Go to previous message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
victory_nag wrote on Sun, 27 July 2008 10:47

Insert into TableA 
Select * from Src_tbl Where Id between 1 to 500000;
Insert into TableA
Select * from Src_tbl where Id between 500000 to 1000000;




You are aware that you will get duplicate data for ID 500000, right?
Previous Topic: Filtering Column
Next Topic: select clob
Goto Forum:
  


Current Time: Sat Dec 10 06:54:04 CST 2016

Total time taken to generate the page: 0.08527 seconds