Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple Update SQL
Message
De
07/04/2004 11:08:40
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00892931
Message ID:
00892936
Vues:
15
This message has been marked as the solution to the initial question of the thread.
>Need a simple SQL to update a code table. We are converting the codes and need to match the current code with the code_old and replace with the code_new.
>
>codes.dbf has codes.code
>code_conv has code_conv.code_old, and code_conv.code_new
>
>The SELECT is the following but I am having trouble with the UPDATE
>
>SELECT a.code, b.code_old, b.code_new FROM CODES a, code_conv b where a.code = b.code_old
>
>Brenda
select code_conv
scan
 update codes set code = code_conv.code_new ;
   where code == code_conv.code_old
endscan
Or assuming indexed :
select codes
set exact on
replace code with code_conv.code_new ;
  for seek(code, 'code_conv', 'code_old')
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform