KI_EXECUTE

Execute an SQL statement

Synopsis:
CALL KI_EXECUTE handle TO status, [count], [bufsize]
'ki_execute( handle, count, bufsize )
ArgumentEnumerationPurpose
handlePrepared handle
statusKDB_ERROR_ENUMReturn status
countRow count
bufsizeSize of the return buffer needed for a SELECT
>KI_EXECUTE

KI_EXECUTE

This function executes an SQL statement previously prepared by KI_PREPARE on the same handle. If rows are affected by the statement, such as in an UPDATE, then a count of the rows will be returned. For SELECT this rowcount will always be zero, rows can be returned using calls to KI_FETCH until KE_ENDOFFILE_ is returned. However, if no rows will be returned the initial KI_EXECUTE will return KE_ENDOFFILE_.

Note: A KI_PREPARE/KI_EXECUTE/KI_FETCH block must be followed by a KI_CLOSE before the handle can be re-used to parse another SQL statement or open a table.

In most cases where there is only one KI_EXECUTE for each KI_PREPARE then the combination function KI_SQL should be used as this can allow KCML to transparently recover from a database failure in a clustered database.

History
Introduced in KCML 5.00
See Also:
KI_BIND_COL, KI_BIND_PARAM, KI_BOUND_COL, KI_BOUND_PARAM, KI_COLUMNS, KI_DATABASES, KI_DEFAULT_ROW, KI_DESCRIBE_COL, KI_ERROR, KI_ERROR_TEXT, KI_FETCH, KI_GET_COL_LIST, KI_GET_ERROR_TEXT, KI_PARTITIONS, KI_PREFETCH_ROWS, KI_PREPARE, KI_SESSIONS, KI_SET_COL_LIST, KI_SQL, KI_SQL_XML, KI_TABLES, KI_TABLESPACES
KCML database status codes