Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to compare and update master table?
Message
De
04/05/2006 15:53:39
 
 
À
04/05/2006 15:35:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows Server 2003
Divers
Thread ID:
01119103
Message ID:
01119355
Vues:
23
This message has been marked as a message which has helped to the initial question of the thread.
>Change one of "Val 3" by another value... and it will not be present in your crsTest.

No it will not, It just compares Key fields. It is easy when you work with tables with just two fields to include them both in join condition, but I doubt you have such case.
lcSql  = [SELECT ]
lcJoin = []
FOR lnFor = 1 TO FCOUNT([MasterTable])
    lcFld   = FIELD(lnFor,[MasterTable])
    lcSql   = lcSql   + IIF(lnFor = 1, [],[,]) + [NVL(MasterTable.]+lcFld+[, TempTable.]+lcFld+[) AS lcFld]
    lcJoin  = lcJoin  + IIF(lnFor = 1, [],[ AND ]) + [MasterTable.]+lcFld+[ == TempTable.]+lcFld
NEXT
lcSql   = lcSql + [ FROM MasterTable ]+;
                  [FULL JOIN TempTable ON ]+lcJoin+;
                  [ WHERE MasterTable.KeyFld IS NULL OR TempTable.KeyFld IS NULL]+;
                  [ INTO CURSOR crsTest]
&lcSql
SELECT crsTest
BROW NORMAL
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform