Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending one record.
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00304200
Message ID:
00304214
Vues:
27
>>What is the easiest way to append all the fields from one (current) record in a table to a second table? The table I want to copy the fields to contains more fields than the first and the order of the matching fields does not corrispond to the order of fields in the first table.
>>
>>I've been using insert but it makes for very large statement because I have to spellout all the fields in both tables.
>>
>>Is there something like Append which matches fields in the target table regardless of their order?
>>
>>TIA
>>
>>Ken Ward
>
>SELECT < 1st Table >
>SCATTER MEMVAR MEMO
>SELECT < 2nd Table >
>INSERT INTO < 2nd TAble > FROM MEMVAR
>
>or use Mark's suggestion.

The difference between the 2 is that append does not always respect data types. For example, if I have an integer data type in 1 table but a character data type for the same field in another table, APPEND FROM will convert the data for you. With INSERT INTO, the data types have to be compatible.

FWIW, I prefer INSERT INTO over any other method. It may be more code, but, to me, it is more clear, when looking at the code, what data is being inserted.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform