KI_WS_START

Create a word search rowset based on words

Synopsis:
CALL KI_WS_START handle, word$, path, [SYM(row$)], [sql] TO status, [rows]
'ki_ws_start( handle, word$, path, [SYM(row$)], [sql], [rows] )
ArgumentEnumerationPurpose
handleHandle
word$String of words to search for
pathWord search path to search on
SYM(row$)Optional row buffer specifying the view
sqlSQL Where Handle
statusKDB_ERROR_ENUMReturn status
rowsNumber of matching rows found
>KI_WS_START

KI_WS_START

Creates a list of rows that contain the given words using the given word search index. The words should be space separated and the case is immaterial. The matching rows can subsequently be retrieved using KI_WS_READ_NEXT.

If the path is negative the rows will be retrieved in descending order. The ordering is determined by the ORDER BY clause specified when the index was created.

If the optional SYM of a row buffer is specified then any view associated with that buffer will be honored in subsequent KI_WS_READ_NEXT calls. This can be a considerable performance improvement on SQL databases. Alternatively you can use KI_SET_COL_LIST to restrict the number of columns at runtime.

On SQL databases where the result set has to be sorted on the application server, KCML will truncate the size of very large result sets to avoid a significant delay in the start operation. The maximum number of rows is set using a handle attribute _KDB_HAND_ATTR_WSMAXROWS.

To fetch the full rows efficiently on a KI_WS_READ_NEXT call, KCML executes an array fetch of a number of rows and then dispenses them to the application one at a time. The number of prefetched rows is set by the prefetch count for that handle as set in the handle attribute _KDB_HAND_ATTR_PREFETCH which has a default of 10. If the intention is to fill a grid with the rows then it is a very good idea to set this prefetch count to the number of rows you intend to read before the KI_WS_START. This will minimize round trips to the DB.

When the result set is no longer required, KI_WS_END should be called to free up memory resources on the handle

This function is only available for type 7 KDB and SQL database tables. The word search index must first have been created with a CREATE WORD INDEX SQL statement.

History
Introduced in KCML 6.00
See Also:
KI_CLOSE, KI_WS_ADD_INDEX, KI_WS_CREATE, KI_WS_DELETE, KI_WS_END, KI_WS_NOISE_INFO, KI_WS_OPEN, KI_WS_READ, KI_WS_READ_NEXT, KI_WS_REWRITE, KI_WS_WRITE
KCML database status codes