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.
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.
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 ?
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? ;)
Could you give me a hand with the syntax? ;)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much, this saves me a lot of manual labour :)