Viv,
The code does work. There no need to reselect c_memo before the endscan. The scan loop works on the alias that is current when the scan begins. Try it for yourself. One of my programmers thought the same thing.
>Hi,
>
>I see you solved the slow SQL but this wouldn't have worked anyway:
>
>select c_memo
>scan for updflag = 'U'
> select bsmemo
> if seek(c_memo.k_seqno)
> replace textln with c_memo.textln
> endif
>endscan
>
>since you're not re-selecting c_memo after the replace....
>
>Regards,
>Viv
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn