KI_SET_ROWS

Set columns from the view in the rows for given rowids

Synopsis:
CALL KI_SET_ROWS h, SYM(view$), SYM(rowid$()), [nRows] TO status
status = 'ki_set_rows( h, SYM(view$), SYM(rowid$()), [nRows] )
ArgumentEnumerationPurpose
hTable handle
SYM(view$)Symbol of row buffer for a view
SYM(rowid$())Location of rows in table, zero for all of them
nRowsOptional, rows to set, zero means use array size
statusKDB_ERROR_ENUMReturn status
>KI_SET_ROWS

KI_SET_ROWS

This can be used to set the value of one or more columns in a batch of rows from a table. The rowid$() array contains the rowids of the rows to be update. 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.

The view$ buffer should be a view appropriate to the table defining the columns to be updated. Each of the columns in the view will be updated using the values taken from this row buffer. The view must not include any word search indexed columns, any BLOB columns or the partitioning column for a partitioned table.

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.

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_ROWS, 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_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