Home » SQL & PL/SQL » SQL & PL/SQL » copy table data to other table
copy table data to other table [message #607123] Mon, 03 February 2014 02:00 Go to next message
xWarriors
Messages: 9
Registered: February 2013
Junior Member
Hello, is there any short query that allows copy table data to other table?
Even when for example table1 has different schema then table2, so i dont have need to use this - INSERT INTO table1 all columns SELECT all columns + new values or columnts that arent in table2 but are in tabl1 FROM table2 etc. I have in table1 like about 20 columns but in table2 there are only 14 for example...
i have 4 history tables and those same 4 history hqt tables, like HST_SRV_CASES and HST_SRV_CASES_HQT. In HST_SRV_CASES there are more columns than in HST_SRV_CASES_HQT, because HST_SRV_CASES_HQT isnt used in long time and i need copy data from that table to usual history table which is being used right now and then delete all data from hqt table when finished copying all.

So is there any short query to do this besides using INSERT INTO?

Thank you for answers
Re: copy table data to other table [message #607125 is a reply to message #607123] Mon, 03 February 2014 02:07 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
I really don't understand your problem. Is it just that you want to project all columns with *, rather than listing them by name? Bad practice, but saves you a few key presses? If so, I suppose you could add the missing columns to the narrower table, so that its DDL matches the wider table.
Re: copy table data to other table [message #607134 is a reply to message #607125] Mon, 03 February 2014 03:08 Go to previous message
manigdv
Messages: 3
Registered: January 2014
Location: Chennai
Junior Member
Copy is different from insert.Data from two tables can be merged into one but coundn't understand your example..!!!
Previous Topic: Substring on digit in a character expression gives ORA-1722
Next Topic: datatype
Goto Forum:
  


Current Time: Thu Apr 25 22:37:35 CDT 2024