KI_GET_SERIAL

Return current unique serial number

Synopsis:
CALL KI_GET_SERIAL handle TO serial, status, [nCache]
'ki_get_serial( handle, serial, [nCache] )
ArgumentEnumerationPurpose
handleTable handle
serialSerial number
statusKDB_ERROR_ENUMReturn status
nCacheCache size
>KI_GET_SERIAL

KI_GET_SERIAL

KDB

This routine is used to return a unique serial number for the table opened on the specified handle and increment it so that a subsequent call will return one greater.

To improve performance in multi-table updates, if the handle is negative KCML assumes that this is part of a transaction and will not reload or save the controls block for the handle. A previous operation in the transaction must have referenced the handle with a lock, e.g. 'KI_READ_HOLD, and a later operation must update it, e.g. a call to 'KI_REWRITE.

ki_status will be set to KE_BADFUNCTION if auto-incrementing mode is in effect as modes should not be mixed.

SQL DB

This routine returns the current value of auto-incrementing serial for the given table.

The serial number for a handle can be reset with a call to 'KI_SET_SERIAL.

History
Introduced in KCML 4.00
See Also:
KI_CLOSE, KI_CLOSE_TABLE, KI_COPY_TABLE, KI_CREATE, KI_CREATE_TMP, KI_DB_NAME, KI_DELETE_ROWS, KI_DROP_TABLE, KI_EXTEND, KI_GET_HANDLE, KI_GROW, KI_INFO, KI_INITIALISE, KI_LOCK_ALL, KI_LOCK_OWNER, KI_MOVE_ROWS, KI_MOVE_TABLE, KI_OPEN, KI_PREFETCH_ROWS, KI_READ, KI_READ_HOLD, KI_READ_HOLD_NEXT, KI_READ_HOLD_PTR, KI_READ_NEXT, KI_READ_PTR, KI_READ_RAW, KI_REBUILD, KI_RESET_CACHEID, KI_REWRITE, KI_SET_DATESTAMP, KI_SET_EXTENT, KI_SET_ROWS, KI_SET_SERIAL, KI_SET_TIMESTAMP, KI_SET_USERSTAMP, KI_SET_WLOCK_COUNT, KI_SIZE_FILE, KI_START, KI_START_BEG, 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