Home » SQL & PL/SQL » SQL & PL/SQL » want to copy 10 tables into 1 table in same database
want to copy 10 tables into 1 table in same database [message #266555] Tue, 11 September 2007 02:22 Go to next message
harmancheema
Messages: 4
Registered: September 2007
Junior Member
hi
i want to copy 10 tables into 1 table.
target table contains all fields which are present in all 10 tables. but structure of all 10 tables differs little bit.
can suggest me any procedure?
in advance.
reply soon.

[mod-edit] removed illiterate IM speak.

[Updated on: Tue, 11 September 2007 07:46] by Moderator

Report message to a moderator

Re: want to copy 10 tables into 1 table in same database [message #266558 is a reply to message #266555] Tue, 11 September 2007 02:27 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Quote:
structure of all 10 tables differs little bit.

And you want to merge into one table. Not possible without conversion.
Re: want to copy 10 tables into 1 table in same database [message #266559 is a reply to message #266555] Tue, 11 September 2007 02:32 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
insert select from tab1
insert select from tab2
...
insert select from tab10

Regards
Michel

Re: want to copy 10 tables into 1 table in same database [message #266565 is a reply to message #266555] Tue, 11 September 2007 02:36 Go to previous messageGo to next message
harmancheema
Messages: 4
Registered: September 2007
Junior Member
target table satisfies all other tables in he structure.........

instead of writin so many inserts, cant i write any procedure????
Re: want to copy 10 tables into 1 table in same database [message #266570 is a reply to message #266555] Tue, 11 September 2007 02:47 Go to previous messageGo to next message
muzahid
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member
Quote:

instead of writin so many inserts, cant i write any procedure????


Yes.
Load all the tables data into cursor then insert from that cursor
Re: want to copy 10 tables into 1 table in same database [message #266572 is a reply to message #266565] Tue, 11 September 2007 02:50 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
NEVER use PL/SQL when you can use SQL.

So many inserts? 10, many??? Thousands I can understand but 10.
Anyway, you have to select in your 10 tables so you have at least 10 select to write.

Regards
Michel
Re: want to copy 10 tables into 1 table in same database [message #266580 is a reply to message #266555] Tue, 11 September 2007 03:06 Go to previous messageGo to next message
harmancheema
Messages: 4
Registered: September 2007
Junior Member
mr Michel Cadot
for advice but this is just testing i want to copy data of 10 tables. if procedure or function works then i to copy 300 odd tables into same target table. thats why i putiing much pressure on some function or procedure......

[mod-edit] removed all illiterate IM speak words.

[Updated on: Tue, 11 September 2007 07:48] by Moderator

Report message to a moderator

Re: want to copy 10 tables into 1 table in same database [message #266593 is a reply to message #266580] Tue, 11 September 2007 03:33 Go to previous message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
First, write in correct english and don't use IM speak.

Anyway you do it you have to query all the tables and so write all the queries.

Regards
Michel
Previous Topic: Warning: Trigger altered with compilation errors.
Next Topic: how to display a query
Goto Forum:
  


Current Time: Tue Dec 06 12:19:41 CST 2016

Total time taken to generate the page: 0.14536 seconds