>>Sure you can change WA in a SCAN, you just need to make sure the original table to be scanned is the currently selected WA before the ENDSCAN. Which is where your problem lies. You really mean to scan oTemp from the looks of it. So oTemp should be before the SCAN command.
>
>Actually, SCAN takes care of the reselecting for you. There is no need to reset the WA before the ENDSCAN.
Interesting. Learn something new every day. I am a natural skeptic, so no matter what MS tells me or what my own future testing indicates, I will probably still explicitly reselect to the scanned table right before the ENDSCAN if I switched WAs. It's a
peace-of-mind [and readability] kinda thing. :)
Mark McCasland
Midlothian, TX USA