PDA

View Full Version : Need help with old dbase III+ program


badcode
12-07-04, 23:34
Hi. The program below was written to update one database of fax numbers from another so that duplicates could be tagged. We recently discovered that if there are multiples of the same fax in the database being updated, only one of those records gets updated. We want all of them to be updated. I'm sure it is just missing a simple line or two, but I am not a programmer and can't seem to find the right command.

select b
use fax1
index on fax to faxind1
select a
use fax2
index on fax to faxind2
update on fax from fax1 replace code with "*"

Thanks in advance for any ideas.

RedAxl
12-09-04, 01:00
That is really what the UPDATE ON statement do.
It only updates the first record that matched from your source.

You must use SET RELATION to get your desired result.

You have to change this line:

index on fax to faxind2
update on fax from fax1 replace code with "*"

Into:

SET RELATION TO fax INTO fax1
REPLACE code WITH "*" FOR a.fax=b.fax

Only the index on the fax1 is required.


I hope this helps.

badcode
12-16-04, 11:37
Thanks for the reply. I tried the new code and it gave the following error:
Variable not found. There was a question mark (?) over the a.fax code line.
Any suggestions? Thanks!