If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > match columns and replace according to match..

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-28-04, 15:25
Mike521 Mike521 is offline
Registered User
 
Join Date: Apr 2004
Posts: 9
match columns and replace according to match..

Hey all,

I used to work with Microsoft Foxpro 6 regularly but now I haven't touched it in months and forgot the proper syntax

I have two databases, they're both the same except that one is outdated. I'd like to match the outdated one up to the good one by product code, and replace all product weights with the newer weight, when the codes match.

foxpro is giving me hell about it though, here's the command I'm trying to execute

---------------------

repla all prods428.product_we with prods.product_we where prods428.product_co = prods.product_co

--------------------------------------------

in english, replace all old products weight with new products weight, where old products code equals the new product code..

Any help? I'm sure it's just a minor syntax thing. Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 05-03-04, 12:06
Nocopy Nocopy is offline
Registered User
 
Join Date: May 2004
Location: Redwood Shores, CA
Posts: 68
Quote:
Originally Posted by Mike521
Hey all,
---------------------
repla all prods428.product_we with prods.product_we where prods428.product_co = prods.product_co
--------------------------------------------

in english, replace all old products weight with new products weight, where old products code equals the new product code..

Any help? I'm sure it's just a minor syntax thing. Thanks in advance
Now I am not a foxpro guru but I have a hunch that you may want to say repace instead of repla. How's that?
__________________
My way or the highway. Yeah
Reply With Quote
  #3 (permalink)  
Old 05-03-04, 15:21
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
I'd suggest that you start with the REPLACE documentation. Your example looks like you are combining the syntax for REPLACE with SQL syntax, and that VFP is having trouble sorting out what you meant!

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On