I've problem when my dynamic query involved with more than one table. for ex,
lvRowid has valid rowid value,
qryhandle:IS-OPEN = TRUE
iv-qryhandle:NUM-RESULTS <> 0 also TRUE,
However I am not sure lRepos = qryhandle:REPOSITION-TO-ROWID(lvRowid) NO-ERROR. returns lRepos = false and ERROR-STATUS:ERROR = no.
When I check qryhandle:NUM-BUFFERS value its 2, then I looked into query string as its composed with one temp-table and one db table.
For ex, for each ttHeader no-lock,
each dbHeader where rowid(dbHeader) = ttHeader.Headerrowid.
I suspect since this query uses two different buffer when I use Reposition-to-rowid system unable to locate right buffer.
Could someone pls suggest generic solution on this?
Also when {&file} as dbtable name ex., dbHeader statements BUFFER {&file}:handle = qryhandle{&brwsfx}:GET-BUFFER-HANDLE(1) value as FALSE
BUFFER {&file}:handle = qryhandle{&brwsfx}:GET-BUFFER-HANDLE(2) value as TRUE
Based on this scenario my "qryhandle:REPOSITION-TO-ROWID(lv-FileRowId)" should be applied on Buffer-HANDLE(2). My question here how do we specify/set current buffer handle as 2 to trigger reposition-to-rowed?
you specify 2 rowids, one for each buffer.
from the docs...
To reposition to a particular row when the query is a join, supply the ROWIDs of the buffers that correspond to the desired row.
REPOSITION-TO-ROWID ( rowid1 , rowid2)