Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 28th, 2006, 06:18 PM
Registered User
 
Join Date: Mar 2006
Location: FBD, HR, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Deepak Chauhan
Default insert multiple records into a table from values

Hi All,

I've quite a strange requirement to insert multiple records into a table.
I have some numbers say 14,32,3,5,7,811,43,45 which i want be inserted into a table T1 with one column N1

but i want all these values to be inserted as different records records in one go without using any looping .

I know this can be done using the INSERT ... SELECT ... Statements.
or slightly different way.

But not sure on how exactly it can be done.

On a slightly different requirement I want a way to get these values in the form of records without using any table.


I mean i need a select statement on the values 1,3,65,22,65,77,33

something like Select * from (1,3,65,22,65,77,33)

and the result be displayed in the form

(No Column Name)
----------------
1
3
65
22
65
77
33

Is it possible.

I know some experts out there can help me do these things.

I will appreciate any help on this

Thanks,
Deepak Chauhan
XpertGuys.com


Reply With Quote
  #2 (permalink)  
Old March 30th, 2006, 06:05 AM
Authorized User
 
Join Date: Mar 2006
Location: , , India.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Alternative to table..
           try using PL/SQL table.

Reply With Quote
  #3 (permalink)  
Old May 12th, 2006, 11:34 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: India.
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

try this

INSERT INTO Table1 SELECT Table2.Column1 FROM Table2

Ashu :-)


Reply With Quote
  #4 (permalink)  
Old May 12th, 2006, 11:35 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: India.
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

u can also use WHERE clause on Table2

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert multiple records mateenmohd Access 13 November 2nd, 2004 09:15 AM
insert multiple records mateenmohd Classic ASP Basics 19 October 18th, 2004 02:22 AM
Insert multiple records in a Inner Join Table rylemer Access 1 August 22nd, 2004 08:44 AM
Insert multiple records in a Inner Join Table rylemer Access VBA 0 July 19th, 2004 04:54 PM
Best way to insert multiple records koo9 ADO.NET 2 June 28th, 2003 09:37 PM



All times are GMT -4. The time now is 11:19 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.