Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to compare and update master table?
Message
From
04/05/2006 16:11:19
 
 
To
04/05/2006 16:03:30
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows Server 2003
Miscellaneous
Thread ID:
01119103
Message ID:
01119366
Views:
21
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform