I've added part (a) "to close any cursor called "MyComponents" first before the SELECT" to my code and we'll see what happens.
Part of the fun of this one is that it is not duplicatable -- that is, the code my run for months (a dozen times a day for the main loop, these lines of code a few thousand times within that loop) with no errors, and then it may start failing. When it does fail, running it again on the same data may not fail at all, or may fail on different data.
>>Oh, I see it now. It returns a logical to llIskit. I agree I would write it the other way around and I would have enclosed the right-hand side in brackets. Each to their own style :)
>>
>>Anyway, I would add code to (a) to close any cursor called "MyComponents" first before the SELECT (b) check for a cursor afer the SELECT and before the RECCOUNT() test as additional tests for trapping the problem.
>
>Well, both parts (a) and (b) should NORMALLY not be necessary; but they might help for debugging purposes.
Jim Nelson
Newbury Park, CA