Home » SQL & PL/SQL » SQL & PL/SQL » Multiple Row insert into a single insert query (oracle 9i)
Multiple Row insert into a single insert query [message #353992] Thu, 16 October 2008 00:50 Go to next message
Sumedha
Messages: 1
Registered: October 2008
Junior Member
I want to insert multiple rows by a single insert query. Can anyone tell me the syntax of it ?
Re: Multiple Row insert into a single insert query [message #353995 is a reply to message #353992] Thu, 16 October 2008 00:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Try with INSERT (SELECT UNION ALL SELECT UNION ALL ...) syntax.

Regards
Michel
Re: Multiple Row insert into a single insert query [message #353997 is a reply to message #353992] Thu, 16 October 2008 00:56 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
./fa/456/0/ google.

i found result on first page.

Regards,
Rajat
Re: Multiple Row insert into a single insert query [message #354013 is a reply to message #353997] Thu, 16 October 2008 01:33 Go to previous messageGo to next message
anasjamil
Messages: 28
Registered: April 2008
Location: KARACHI
Junior Member

quite easy to do it. use as select after insert into

regards,
anas jamil

[Updated on: Thu, 16 October 2008 02:09] by Moderator

Report message to a moderator

Re: Multiple Row insert into a single insert query [message #354152 is a reply to message #353992] Thu, 16 October 2008 11:13 Go to previous message
himang
Messages: 282
Registered: March 2005
Location: Bangalore
Senior Member

Not sure if this is what you are looking for

create table test(col1 varchar2(100), col2 number);

insert ALL 
into test values('A',10)
into test values('B',20)
into test values('C',30)
into test values('D',$0)
SELECT * FROM DUAL;	


Otherwise INSERT INTO .. SELECT * FROM ...as others already posted...
Previous Topic: Ref Cursors - Query
Next Topic: How can one make a Distinct Multiplication Table ?
Goto Forum:
  


Current Time: Wed Dec 07 03:00:14 CST 2016

Total time taken to generate the page: 0.23425 seconds