I have a query where I do:
PRESELECT EACH table NO-LOCK WHERE <where-clauses> BREAK BY field1 BY field2 BY field 3
The 25 first-of(field2) of the table are copied to a temp-table. The temp-table is returned to a gui.
Now I want to add "pagination" for loading of more results to tried adding each records rowid to the temp-table and then utilize REPOSITION-TO-ROWID to get the query started at another record. This doesn't seem to work - the same data is always returned. I've checked error-status, num-messages etc without any hints.
I've used REPOSITION-TO-ROWID without BREAK BYs successfully before. Is it just not working with break by clauses or am I doing some other error here?
11.6 on Ubuntu
DEFINE QUERY qCache FOR <tablename> SCROLLING CACHE 50 RCODE-INFORMATION.
hQuery = QUERY qCache:HANDLE.
cQuery = "PRESELECT EACH <tablename> NO-LOCK WHERE "
+ " " + <lots-of-where-clauses>"
+ " " + "BREAK BY <tablename>.<field1> BY <tablename>.<field2> BY <tablename>.<field3>".
/* This is where I hoped to jump forward */
IF <rowid-variable> <> ? THEN
DO WHILE AVAILABLE <tableName>:
IF hQuery:FIRST-OF("<tablename>.<field2>") THEN DO:
BUFFER-COPY <tablename> TO <temptable>
ASSIGN <temptable>.rwid = ROWID(<tablename>).
iNumResult = iNumResult + 1.
IF iNumResult >= 25 THEN
complete /working/ example at:
maybe you can expand your non-working to a complete working example? :-)
After posting I made a clean example with a static query and it obviously works great. Away from work a couple of days but will go over everything once more when back.