KI_CLOSE

Close a handle

Synopsis:
CALL KI_CLOSE handle, [bClose] TO [status], [nRefCount]
nRefCount = 'ki_close( handle, [bClose] )
ArgumentEnumerationPurpose
handleHandle to close
bCloseTRUE for forced close rather than decrement ref count
statusKDB_ERROR_ENUMReturn status
nRefCountThe new reference count after the close.
>KI_CLOSE

KI_CLOSE

This function closes the table, flat file or result set open on the handle allowing it to be reused. The handle itself still exists and can be freed with a KI_FREE_HANDLE operation. Tables should be closed promptly in order that the access control information is kept up-to-date.

Pooled handles

If the handle refers to a pooled handle, KI_CLOSE will just decrement the reference count on the handle. No actual close is performed even when the new reference count is zero. However the optional bClosed parameter can be set to TRUE to force a close of the table if the reference count is zero and KI_CLOSE_TABLE can be used to close all the handles open on a table that have a zero reference count. In both these cases the pooled handle is also deallocated without the need for a KI_FREE_HANDLE.

The optional nRefCount result argument will be updated with the new reference count after the close.

History
Introduced in KCML 3.00
See Also:
KI_BU_CREATE, KI_BU_OPEN, KI_BU_READ, KI_BU_WRITE, KI_CLOSE_TABLE, KI_DB_NAME, KI_DROP_TABLE, KI_EXTEND, KI_GET_HANDLE, KI_GET_SERIAL, KI_INFO, KI_INITIALISE, KI_LOCK_ALL, KI_OPEN, KI_PREFETCH_ROWS, KI_REBUILD, KI_RESET_CACHEID, KI_SET_DATESTAMP, KI_SET_SERIAL, KI_SET_TIMESTAMP, KI_SET_USERSTAMP, KI_UNLOCK_FILE, KI_VERIFY, 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_START, KI_WS_WRITE
KCML database status codes