Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Update records in a table
Hi,
I have two databases, they are basically the same dbase1 is the
original one, and dbase2 in the new one. What I'm trying to do
is replace the contents of a table in dbase1 with the contents of a
table in dbase2. Dbase2 has the latest data in it.
To expand on this. Both of the tables are called "advisory", the
client may have made some changes to a couple of records in this table
within dbase1. So when I update the contents I only wish to change
records which the client has not changed. Any record that has changed
has a flag set to .T.
So what I have done is:
CLOSE DATABASES
CLEAR
OPEN DATABASE "c:\sas update\gen001\sas.dbc"
USE advisory EXCL
DELETE FROM advisory WHERE recchanged =.F.
PACK
This then leaves only the records which have changed. I now want to
add all other records from the new table in dbase2. I am not sure if
the best way is to use an APPEND FROM or a REPLACE, or is there a
better way.
The Key to both tables is the mangercode.
The table will have approximatly 70,000 records so I can't use an ARRAY.
Any advice / help would be much appreciated.
Cheers
Rob
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement