Link to home
Start Free TrialLog in
Avatar of robd2007
robd2007

asked on

Replace a list of item codes in .dbf file

I have a .dbf database table where I have a list of item codes in a column KITNO that need to be replaced with new codes.
I am using Borland Database Desktop v7 to make changes, using the sql editor.

to replace 1 itemcode at a time I would use

update kits
set kitno = "newcode"
where kitno = "oldcode"

What I would like to do though, is replace a whole list of "newcode" with corresponding "oldcode". There is far too many to want to do one at a time :)

Any suggestions on how to do this would be appreciated.
Avatar of twinsoft
twinsoft
Flag of Greece image

Hi, if you have the new values in a table, why don't you use a while not eof loop to run an edit statement foreach record in the table ?
Avatar of robd2007
robd2007

ASKER

Thanks for the reply, that sounds great as I have a table with new and old.

Could you give me a hand with the syntax? ;)
ASKER CERTIFIED SOLUTION
Avatar of twinsoft
twinsoft
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much, this saves me a lot of manual labour :)