Home » SQL & PL/SQL » SQL & PL/SQL » Insert from multiple columns into multiple rows
Insert from multiple columns into multiple rows [message #36950] Mon, 07 January 2002 05:33 Go to next message
Nivedita
Messages: 2
Registered: July 2001
Junior Member
Hi:

There are 2 tables one table A has almost 100 columns and each storing a value. Out of these 45 are to become 45 rows in Table B in my procedure. How can I achieve this without having to write a 45 column insert.

Any help is appreciated...

Thanks in advance
Re: Insert from multiple columns into multiple rows [message #36956 is a reply to message #36950] Mon, 07 January 2002 10:18 Go to previous messageGo to next message
raghav banuru
Messages: 6
Registered: January 2002
Junior Member
write a procedure and use cursor that will slove your prob.

if you have any questions send me mail

thanks
Re: Insert from multiple columns into multiple rows [message #36965 is a reply to message #36950] Mon, 07 January 2002 21:16 Go to previous message
Satish Shrikhande
Messages: 167
Registered: October 2001
Senior Member
Method 1 - This will insert the rows in B as per your condition in SELECT statement .
insert into B(select <column_name>
from A where rownum<46 )

Method 2 -This will create a table with the data populated through the SQL select query .
Create table B as select <column_name>
from A where rownum<46 )

Here you can give the condition as per your requirement ,Hope this can help you

Nivi , why i am relpying you is i have very good friend in Srilanaka and when i saw your name , i was so happy ..Where do you from ?
Her name is nivadita and ur's nivedita

Anyway Cya
Previous Topic: delete previous data n load new
Next Topic: Need Help
Goto Forum:
  


Current Time: Fri Mar 29 09:14:51 CDT 2024