Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
From a record of a table to another
Message
De
13/10/2007 08:28:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01260800
Message ID:
01260803
Vues:
21
>I have two tables with the same structure, and I using the got below
>
>Scan table1
>
> select table 2
> appe blank
> ** if this record is not in table1 yet
> ** get data of this record to current record of table1
>endscan
>
>Is it possible to append data from a record of table1
>to a redord of table2 without having to store table1 fields to variables?
Use table2
append from table1 for yourcondition
If you want to add all records which are in table1 and not in table2, into table2, it's easier to find the missing records first
SELECT * FROM table2 WHERE uniqid NOT in (SELECT uniqid FROM table1) into cursor temp
Select table2
Append from dbf('temp')
You can do all this in one Insert command, but then you must list all the fields.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform