Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to compare and update master table?
Message
 
À
04/05/2006 15:08:57
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:
01119340
Vues:
19
>Yes I have a key field in master table (the same as in the temp table).

Al Selects should do the job, The same thing with one select:
(much NVL's here :-)
CREATE CURSOR Test  (Fld1 Int, Fld2 Char(10))
CREATE CURSOR Test1 (Fld1 Int, Fld2 Char(10))
INSERT INTO Test VALUES (1, [Val 1])
INSERT INTO Test VALUES (2, [Val 2])
INSERT INTO Test VALUES (3, [Val 3])

INSERT INTO Test1 VALUES (1, [Val 1])
INSERT INTO Test1 VALUES (4, [Val 4])
INSERT INTO Test1 VALUES (3, [Val 3])

SELECT NVL(Test.Fld1, Test1.Fld1) AS Fld1,;
       NVL(Test.Fld2, Test1.Fld2) AS Fld2;
FROM Test;
FULL JOIN Test1 ON Test.Fld1 = Test1.Fld1;
WHERE Test.Fld1 IS NULL OR Test1.Fld1 IS NULL;
INTO CURSOR crsTest

SELECT crsTest
BROWSE NORMAL
(assuming that Fld1 is a key field)
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