KI_DELETE_ROWS

Delete rows from a table

Synopsis:
CALL KI_DELETE_ROWS handle, SYM(rowid$()), [nRows] TO status
status = 'ki_delete_rows( handle, SYM(rowid$()), [nRows] )
ArgumentEnumerationPurpose
handlehandle
SYM(rowid$())Location of rows to be deleted
nRowsOptional, rows to delete, zero means use array size
statusKDB_ERROR_ENUMReturn status
>KI_DELETE_ROWS

KI_DELETE_ROWS

This can be used to delete a batch of rows from a table. The rowid$() array contains the rowids of the rows to be deleted. It should be a single dimensioned array with each element an instance of the _KDB_ROWID record. The array can be sized to the number of rowids available but, if larger, the actual number of rowids in the array can be specified with the optional nRows parameter. A zero value for this parameter implies that all the array elements are significant.

This function can be enclosed in a WHILE TRANS transaction but if used outside of a transaction it will execute in an internal transaction guaranteeing an atomic result. Because it uses a temporary table and Oracle DDL will commit any transaction, the statement should not be used in a WHILE TRANS for Oracle.

If a rowid is not found in a KDB7 table then a _KE_NOTFOUND error will be reported and the operation will be abandoned at that point. On an SQL database like Oracle the error will be silently ignored.

If there are no word indexes on the table then the operation can be done entirely on the database server but word indexing requires the indexed columns of the rows to be processed by the application server incurring a greater performance overhead.

Compatibility

Not available for KDB6 or earlier.

History
Introduced in KCML 6.69
See Also:
KI_BUILD, KI_COPY_TABLE, KI_CREATE, KI_CREATE_TMP, KI_DELETE, KI_DELETE_WHERE, KI_END, KI_ERROR, KI_ERROR_TEXT, KI_FETCH, KI_GET_ERROR_TEXT, KI_GET_SERIAL, KI_GROW, KI_INFO, KI_INITIALISE, KI_LOCK_ALL, KI_LOCK_OWNER, KI_MOVE_ROWS, KI_MOVE_TABLE, KI_OPEN, 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_REBUILD, KI_REWRITE, KI_SET_EXTENT, KI_SET_ROWS, KI_SET_SERIAL, KI_SET_WLOCK_COUNT, KI_SIZE_FILE, KI_START, KI_START_BEG, KI_START_BETWEEN, KI_START_FIRST, KI_START_ON, KI_START_ROW, KI_START_ROW_BETWEEN, KI_UNLOCK, KI_UNLOCK_FILE, KI_VERIFY, KI_WMODE_BITMAP, KI_WRITE, KI_WRITE_PTR, KI_WRITE_RAW, KI_WS_CREATE, KI_WS_DELETE, KI_WS_OPEN, KI_WS_READ, KI_WS_REWRITE, KI_WS_WRITE
KCML database status codes