Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating with joins
Message
 
 
À
01/10/2003 09:16:18
Leshel Rich
Plains Cotton Coop Assoc
Lubbock, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00833805
Message ID:
00833808
Vues:
28
FoxPro doesn't support JOIN in UPDATE/DELETE SQL commands. You can use combination of SCAN...ENDSCAN and UPDATE. Something like
SELECT test2
SCAN FOR test2.field2 = '123456' ;
    and test2.field4 = '789102' ;
    and NOT test2.field5 and NOT test2.field6
  Update test1 Set test1.field1 = 10 ;
  WHERE test1.field3 = 'TEST' ;
    and test1.field2 = test2.field2
ENDSCAN
>I am trying to do an update with joins. I cannot get this to work in FoxPro. Do I have something wrong with my update, or is this a limitation in FoxPro?
>Here is the code:
>Update test1 ;
>Set test1.field1 = 10 ;
>  from test1   ;
>  inner join test2  ;
>    on test2.field2 = test1.field2  ;
>  WHERE test2.field2 = '123456' ;
>    and test1.field3 = 'TEST' ;
>    and test2.field4 = '789102' ;
>    and test2.field5 = .f. and test2.field6 = .f.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform