KI_EXECUTE
Argument | Enumeration | Purpose |
---|---|---|
handle | Prepared handle | |
status | KDB_ERROR_ENUM | Return status |
count | Row count | |
bufsize | Size of the return buffer needed for a SELECT |
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.