KI_START_ROW_BETWEEN

Find rows between start and end keys limiting rows returned to max rows

Synopsis:
CALL KI_START_ROW_BETWEEN handle, path, SYM(row1$)>, nCols1, SYM(row2$)>, nCols2, [max_rows], [bLock], [bSkipMatch], [sql] TO status
status = 'ki_start_row_between( handle, path, SYM(row1$)>, nCols1, SYM(row2$)>, nCols2, [max_rows], [bLock], [bSkipMatch], [sql] )
ArgumentEnumerationPurpose
handleHandle
pathPath number
SYM(row1$)>Row specifying starting key
nCols1Number of significant columns in a starting key
SYM(row2$)>Row specifying end key
nCols2Number of significant columns in a ending key
max_rowsMax rows to return
bLockLock result set
bSkipMatchSkip matching row
sqlSQL Where Handle
statusKDB_ERROR_ENUMReturn status
>KI_START_ROW_BETWEEN

KI_START_ROW_BETWEEN

This function is similar to KI_START_BETWEEN but it defines the initial and final key using the row buffers themselves, thus avoiding the use of KI_BUILD, and which can limit the columns in the result set if the initial row buffer was DIMmed using a DEFVIEW. Using a view can lead to significant performance improvements with SQL databases.

If the optional bSkipMatch flag is set to TRUE then the first rows in the result set are not returned if they match the supplied key. For positive path values a subsequent KI_READ_NEXT will read the first row with a key greater than the supplied key. For negative path values a subsequent KI_READ_NEXT a subsequent KI_READ_NEXT on the same negative path will read the last row with a key less than the supplied key.

Compatibility

This function is only available for KDB type 7 and SQL database tables. It was introduced with KCML 6.60.

It was common practice with KDB to make columns insignificant by setting them to ALL(00) or ALL(FF), depending on direction. Because HEX(FF) is not a legal UTF-8 character this may cause problems with SQL databases and is the practice is strongly deprecated. See connection attributes for information about how the _KDB_CONN_ATTR_KEY_PADDING attribute can be used to control how padding is handled.

History
Introduced in KCML 6.60
See Also:
KI_BUILD, KI_DELETE, KI_DELETE_ROWS, KI_DELETE_WHERE, KI_END, KI_ERROR, KI_ERROR_TEXT, KI_FETCH, KI_GET_ERROR_TEXT, KI_LOCK_OWNER, KI_MOVE_ROWS, KI_READ, KI_READ_ARRAY, KI_READ_HOLD, KI_READ_HOLD_NEXT, KI_READ_HOLD_PTR, KI_READ_NEXT, KI_READ_PTR, KI_READ_RANDOM, KI_READ_RAW, KI_REWRITE, KI_SET_ROWS, KI_START, KI_START_BEG, KI_START_BETWEEN, KI_START_FIRST, KI_START_ON, KI_START_ROW, KI_UNLOCK, KI_WRITE, KI_WRITE_PTR, KI_WRITE_RAW
KCML database status codes