Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacing/ updating data in a database
Message
 
 
To
01/05/2002 18:39:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00651651
Message ID:
00651669
Views:
27
The REPLACE command w/o IN clause updates the table in the current work area. In your case it's cursor created by SELECT command. I don't see why you would need select here.
select a_alias
REPLACE field1 WITH variable2, field2 with newnumber ;
           FOR field1 = variable1
>hey everyone,
>i have a problem. i am writing some code to update certain fields from a database. the code resides within a program that does other stuff as well. the problem is that i cannot figure out how to replace data in this database or update the data. here is the code i am trying to use.
>
>select a_alias
>select * from a_alias where field1 = variable1 and field2 < 0
>replace field1 with variable2 for field1 = variable1 ,
> field2 with newnumber
>
>when i run this, it tells me that i cannot update the cursor.
>is there a better way to do this. i tried the locate command but it was dog slow. any advise would be appreciated. thanks.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform