Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacing only blank fields
Message
De
17/01/2003 11:12:52
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00742691
Message ID:
00742906
Vues:
18
Max,

Besides the other information that was given to you (which was good), the "where" part of your statement will cause a syntax error...use "for" instead. Also, using your syntax, you will have problems if the correct table is not currently selected.

Some ways to do it:
select table1
replace field1 with "default_value" for empty(field1)
Or...
update table1 set field1 = "default_value" where empty(field1)
Or...
replace field1 with "default_value" for empty(field1) in table1
>Good day everyone!
>I am trying to code a button that when pressed will look through a field and if it finds any empty fields in the table replace it with a default value.
>I was thinking something like the following but I know it's wrong:
>
>REPLACE ALL table.field with "default_value" where table.field=""
>
>Can anyone please help with the proper syntax? Thanks!
>Max
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform