KI_DELETE_ROWS
Argument | Enumeration | Purpose |
---|---|---|
handle | handle | |
SYM(rowid$()) | Location of rows to be deleted | |
nRows | Optional, rows to delete, zero means use array size | |
status | KDB_ERROR_ENUM | Return status |
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.
Not available for KDB6 or earlier.