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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a substitute for the Replace function in FoxPro

Status
Not open for further replies.

OasisChurch

Technical User
Mar 28, 2002
20
hi All,
I am looking for a substitute for the replace function.
Here is my standard SQL:
UPDATE ownertmp set parno1 = REPLACE(parcelid,'CA','00')

NOTE: When I run this it tries to call a program called replace

thanks
--scotta
 
You probably need REPLACE command:

REPLACE FieldName1 WITH eExpression1 [ADDITIVE]
[, FieldName2 WITH eExpression2 [ADDITIVE]] ...
[Scope] [FOR lExpression1] [WHILE lExpression2]
[IN nWorkArea | cTableAlias]
[NOOPTIMIZE]

or UPDATE SQL command:

UPDATE [DatabaseName1!]TableName1
SET Column_Name1 = eExpression1
[, Column_Name2 = eExpression2 ...]
WHERE FilterCondition1 [AND | OR FilterCondition2 ...]]

Stella
 
Because the () are next to the command:

REPLACE() it is treating it as a USER-DEFINED function, which is a program. Therefore, you're getting the program not found error.

Example of Replace command.
Replace customer.city WITH "ALGONAC"

Jim Osieczonek
Delta Business Group, LLC
 
Look up the STRTRAN() function..... I think it's what you're looking for.

dennis
 
UPDATE ownertmp set parno1 = CHRTRAN(parcelid,'CA','00')

CHRTRAN(cSearchedExpression, cSearchExpression, cReplacementExpression)

 
STRTRAN() and CHRTRAN(), both mentioned above, work similarly, but are designed for different uses.

STRTRAN() searches a character string for matches to a search character string and can optionally replace that section with another string. Think of this as string based.

CHRTRAN() searches a character string for matches to multiple search characters and replaces the respective character matches with other characters. Think of this as character based.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top