Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update records in a table
Message
De
06/08/2002 17:23:59
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Update records in a table
Divers
Thread ID:
00686781
Message ID:
00686781
Vues:
80
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
Fil
Voir

Click here to load this message in the networking platform