Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacing only blank fields
Message
From
17/01/2003 11:12:52
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00742691
Message ID:
00742906
Views:
17
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
Previous
Reply
Map
View

Click here to load this message in the networking platform