Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Looping and updating
Tue, May 28 2019 12:00 PMPermanent Link

Matthew Jones

Okay, I have a query, with: WHERE column = 'VALUE'

So I'm looping around: while not query.EOF do

If I just display the data, I get 50 items.

If I include an: UPDATE SET column = 'DIFFERENT'
then I get 25 items (might be approx).

This is done using a different query component. How can I get an "unchanging" result set so that it keeps including the ones I've changed in the ".Next" processing?

--

Matthew Jones
Tue, May 28 2019 12:03 PMPermanent Link

Matthew Jones

I should say I started a transaction for the whole lot, in case that matters...

--

Matthew Jones
Tue, May 28 2019 12:21 PMPermanent Link

Terry Swiers

"Matthew Jones" wrote:

... How can I get an "unchanging" result set so that it keeps including the ones I've changed in the ".Next" processing?

--

When you declare the cursor for the record retrieval, you need to specify that you want a insensitive result set.  It should look like this:

DECLARE aCursor INSENSITIVE CURSOR FOR aStmt;
Tue, May 28 2019 12:32 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Matthew


As Terry says, or if you're using a query component set RequestSensitive to false. The other alternative is to use SQL to create a temporary table from the query result (essentially what setting RequestSensitive to false)

Roy Lambert
Image