Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update from another table.
Message
De
08/12/2005 18:09:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01076432
Message ID:
01076448
Vues:
21
>Hi.
>Is it possible to update a table's field from another one's? I mean, something like... (I know this doesn't work, ok??)
>
>update mytable set myfield = othertable.otherfield where othertable.keyfield=mytable.keyfield
>
>Thanks a lot in advance...

It works just as you write but you need to select othertable and if would scan the table:
select othertable
scan
 update mytable set myfield = othertable.otherfield ;
    where othertable.keyfield=mytable.keyfield
endscan
Replace is easier.
select myTable 
replace myfield with othertable.otherfield ;
    for seek(mytable.keyfield,'othertable','keyfieldtag')
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform