>Need a simple SQL to update a code table. We are converting the codes and need to match the current code with the code_old and replace with the code_new.
>
>codes.dbf has codes.code
>code_conv has code_conv.code_old, and code_conv.code_new
>
>The SELECT is the following but I am having trouble with the UPDATE
>
>SELECT a.code, b.code_old, b.code_new FROM CODES a, code_conv b where a.code = b.code_old
>
>Brenda
select code_conv
scan
update codes set code = code_conv.code_new ;
where code == code_conv.code_old
endscan
Or assuming indexed :
select codes
set exact on
replace code with code_conv.code_new ;
for seek(code, 'code_conv', 'code_old')
Cetin