Thanks to both of you for the better ways of coding this! I will definitely consider taking that approach in the future. I was able to get my code to work by changing the EOF condition to
IF !EOF() and v_zips.dealerid <> zips.dealerid
Not sure what the deal is on why I was having the update problem when it was just putting the same dealerid back in the field. It may have something to do with the MySQL ODBC, it seems a bit flaky.
Thanks again for the help!
Greg
>
>UPDATE v_zips ;
> SET dealerid = zips.dealerid ;
> FROM v_zips ;
> JOIN zips ON zips.zipcode == v_zips.zipcode
>
>
>>
>>I've got a VERY simple bit of code:
>>
>>
>>SELECT v_zips
>>SCAN
>> SELECT zips
>> LOCATE FOR zips.zipcode == v_zips.zipcode
>> IF !EOF()
>> SELECT v_zips
>> replace v_zips.dealerid WITH zips.dealerid
>> ENDIF
>>
>>ENDSCAN
>>
>>
>>Basically this is just to update a database server with changes to with dealer is tied to a zip code.
>>
>>I get an update conflict when it tries to move to the second record in the scan.
>>
>>Now here is the weird part. You can change data in the browse window of v_zips just fine. Even more weird, you can type the replace command in the command window and then skip off the record and it updates just fine. I did the manual operation in the command window ten times with no conflicts.
>>