Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How do I replace one table with another

How do I replace one table with another

From: Alexander Bisset <a-bisset_at_aberdeen-harbour.co.uk>
Date: Tue, 21 Jul 1998 17:48:26 +0100
Message-ID: <901039669.2142.0.nnrp-02.9e987879@news.demon.co.uk>


In my Oracle 7.3 database I have a table (call it A) which contains data that provides a foreign key reference to my main tables. This table is constructed from data purchased from a 3rd party on which we get quarterly updates and I treat the table as read-only apart from when I do the update.

I am now at the stage of doing the first quarterly update and I want to know the best way of going about this. I have used SQL*Loader to get the data off CD into a temporary table in Oracle. This temporary table has been cleaned and the data formatted to the stage that I now need to replace table A with the temporary table copy (call it B) (ie:both tables have idenitical columns and constraints, just different versions of the data).

So I now have working tables the users update (call them C), table A with the state of the reference data 3 months ago, table B with the current reference data (although still held in a "staging area"). Tables C have foreign key references to table A and tables C are frequently updated by users (although I could take them offline for the duration of the update if really necessary).

What I need to do is to drop table A and rename table B as table A ie:slide table B into place. (BTW all records in table A will exist in table B perhaps with some amendments and some extra records). What I am not sure about is what effect the existing foreign keys and references in tables C will have on dropping table A. Is dropping and renaming the way to go? Should I do updates? If so what method would you recommend?

Any help gratefully received. Additional info provided on request. Received on Tue Jul 21 1998 - 11:48:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US