auto a copy of a table

iuphim

Registered User.
Local time
Today, 17:54
Joined
Oct 30, 2008
Messages
43
how do you write a query or a macro that automatically copy an oracle table and rename it each week to do a comparison?

thanks
 
how do you write a query or a macro that automatically copy an oracle table and rename it each week to do a comparison?

thanks

Copying it is easy
Code:
[COLOR=blue][B]Insert[/B][/COLOR] [COLOR=blue][B]Into[/B][/COLOR] {[COLOR=darkorchid][B]YourNewTableName[/B][/COLOR]}
[B][COLOR=blue]Select[/COLOR][/B] [B]*[/B] [COLOR=blue][B]From[/B][/COLOR] {[COLOR=darkorchid][B]YourOldTableName[/B][/COLOR]}
{ [COLOR=blue][B]Where[/B][/COLOR] {[COLOR=seagreen][B]Any Relevant conditions[/B][/COLOR]} }

Note that the Where Clause is optional and used only if it is required.

Comparison would have to be defined by the contents of the data
 
Copying it is easy
Code:
[COLOR=blue][B]Insert[/B][/COLOR] [COLOR=blue][B]Into[/B][/COLOR] {[COLOR=darkorchid][B]YourNewTableName[/B][/COLOR]}
[B][COLOR=blue]Select[/COLOR][/B] [B]*[/B] [COLOR=blue][B]From[/B][/COLOR] {[COLOR=darkorchid][B]YourOldTableName[/B][/COLOR]}
[/quote]
 
 
Would this delete all the old data?
 
No it would not. I presumed that your copy of the table was to be into a NEW table that had no records. You can always Delete From YourNewTableName if you need to remove old records first.
 

Users who are viewing this thread

Back
Top Bottom