In Extensbile Strage Engine (ESE/JetBlue) I've got a table that contains data I'd like to locate using two indexes
assuming that each row has three integers X, Y, and Z. I'd like to quickly locate all the rows where X=10 and Y=20 (for example)
the resulting set would contain all the entries where X=10, Y=20, and Z= whever Z happened to be
is this possible?
the sequence of
JetSetCurrentIndex(), JetMakeKey(), JetSeek(), and JetMove() confuse me. i'm not 100% this is even possible without searching for X=10 and then filtering all values where Y!=20 myself?
thanks!
You can do that with the JetIntersectIndexes API, which returns all records contained in two index ranges. You need to:
For the first key value:
JetOpenTable
)JetSetCurrentIndex
)JetMakeKey
, JetSeek
)JetMakeKey
, JetSetIndexRange
)For the second key value:
JetOpenTable
)JetSetCurrentIndex
) JetMakeKey
, JetSeek
)JetMakeKey
, JetSetIndexRange
).Call JetIntersectIndexes
with the two index ranges to create a temporary table of matching bookmarks.
JetMove
). Retrieve the record bookmarks (JetRetrieveColumn
) and go to the records (JetGotoBookmark
).JetCloseTable
).