J
Jens Dahlin
Guest
I have a query where I do: PRESELECT EACH table NO-LOCK WHERE 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 "Complete" code: DEFINE QUERY qCache FOR SCROLLING CACHE 50 RCODE-INFORMATION. hQuery = QUERY qCache:HANDLE. cQuery = "PRESELECT EACH NO-LOCK WHERE " + cCacheWhere + " " + " + " " + "BREAK BY . BY . BY . ". hQuery:QUERY-PREPARE(cQuery) NO-ERROR. hQuery:QUERY-OPEN(). /* This is where I hoped to jump forward */ IF <> ? THEN hQuery:REPOSITION-TO-ROWID( ) NO-ERROR. hQuery:GET-NEXT(). DO WHILE AVAILABLE : IF hQuery:FIRST-OF(" . ") THEN DO: CREATE . BUFFER-COPY TO ASSIGN .rwid = ROWID( ). iNumResult = iNumResult + 1. IF iNumResult >= 25 THEN LEAVE createResult. END. END.
Continue reading...
Continue reading...