Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Replace program 2

Status
Not open for further replies.

Peter10

IS-IT--Management
Dec 22, 2002
6
0
0
FI
I need a simple three or five line program and can't recall the structure.

I have a table with a field city. In many of them I've entered SLC rather than Salt Lake city. I want to open the table exclusive and replace that field where it is SLC with Salt Lake City. Replace all works great, but I only want to replace it where the field holds SLC. Help!!!!

Got brain freeze.

Thanks
 
Try this:

REPLACE ALL city WITH 'Salt Lake City' FOR city = 'SLC'

Dave S.
 
You da man. Where do I send the check....

Thanks. It's the little things in life that make it sooo much easier.

Muchichasmas Gracias it was the = sign I was missing.

Pete
 
just my 2 cents worth....

i have found in a multiuser application where there is a large database that the 'replace all' locks the header of the file, and prompts the 2nd user to wait. of course if the user misses the prompt, and presses the esc key as they often do, then problems occur.

instead of 'replace all', i use a scan... endscan as follows

scan FOR city = 'SLC'
REPLACE city WITH 'Salt Lake City'
endscan

of course if you are just updating from the command window, then 'replace all' is the way to go


Pete Bloomfield
Down Under
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top