Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to compare and update master table?
Message
 
À
04/05/2006 16:03:30
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:
01119366
Vues:
20
>Thank you Borislav. I will use your approach. I have just changed the last part like this...
>
>
>lcSql   = lcSql + [ FROM TempTable]+;
>                  [ LEFT JOIN MasterTable ON ]+lcJoin+;
>                  [ INTO CURSOR crsTest]
>
>
>...because I just want to know what is new in TempTable.

All will look like this then:
lcSql  = [SELECT ]
lcJoin = []
FOR lnFor = 1 TO FCOUNT([MasteTable])
    lcFld   = FIELD(lnFor,[MasteTable])
    lcSql   = lcSql   + IIF(lnFor = 1, [],[,])     + [TempTable.] + lcFld
    lcJoin  = lcJoin  + IIF(lnFor = 1, [],[ AND ]) + [TempTable.] + lcFld + [ == MasterTable.]+lcFld
NEXT
lcSql   = lcSql + [ FROM TempTable ]+;
                  [LEFT JOIN MasterTable ON ]+lcJoin+;
                  [ WHERE MatserTable.KeyFld IS NULL]+;
                  [ INTO CURSOR crsTest]
...
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
Répondre
Fil
Voir

Click here to load this message in the networking platform