Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip of the Day -- SQL Subqueries
Message
De
30/09/1999 13:27:35
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00271146
Message ID:
00271200
Vues:
23
>It turns out that you can do this in SQL "DELETE" and "UPDATE" commands too. This is implied in the VFP Help, but not explicitly stated. For example, you can:


Yup. Another interesting note for xBase DELETES and REPLACES. If you don't want to set a relation on a file, but need to update the contents based on the existence of a record in another table, you can use code like:

REPLACE ChildTable.FK2 WITH ParentTablePK2 FOR SEEK(Childtable.FK1, "ParentTable", "PK1")

Same goes for DELETES. You can delete all records whose key occurs in another table with syntax like:

SELE MyTable
DELETE FOR SEEK(MyTable.SomeField, "SomeOtherTable","SomeTag")
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform