Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL REPLACE help
Message
From
13/07/2001 14:19:01
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00530393
Message ID:
00530427
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
>table1.costctr needs to be converted to a new value. If have put the pseudo code below but would like to do it in an SQL statement.
>
>if table1.costctr = costctr.o_costctr and
> control.site_id = costctr.site_id
>replace table1.costctr with costctr.n_costctr
>endif
>

UPDATE Table1 SET CostCtr = CostCtr.n_CostCtr ;
WHERE Table1.CostCtr = CostCtr.o_costctr ;
AND Control.site_id = CostCtr.site_id

However, it's important to understand that that works with the values of the current records in CostCtr and Control. It's not like XBase code where you can SET RELATION and assume the tables stay in synch as you move.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform