KI_SQL

prepare and execute an SQL statement

Synopsis:
CALL KI_SQL handle, sql$, [extratext$] TO status, [colcount]
'ki_sql( handle, sql$, [extratext$], [colcount] )
ArgumentEnumerationPurpose
handleHandle
sql$SQL statement
extratext$Extra SQL
statusKDB_ERROR_ENUMReturn status
colcountNumber of columns in result set
>KI_SQL

KI_SQL

This combines KI_PREPARE and KI_EXECUTE into one function for convenience and to make it possible to recover following a database server failure. You should only use these functions separately if you need to invoke KI_EXECUTE multiple times for a single KI_PREPARE. Combining the two functions make it possible for KCML to replay both transparently if a database failure is detected.

The number of columns in any result set is returned in the optional colcount which will be zero if there is no result set, as in a DELETE or UPDATE.

If a negative handle number is passed then only SELECT statements can be parsed as a security measure.

On Oracle and Postgres the optional extratext$ parameter will be appended to CREATE TABLE and CREATE INDEX statements, after any default storage and tablespace clauses, to allow custom partitioning schemes to be deployed.

Compatibility

Prior to KCML 6.40 the function now called KI_SQL_XML was named KI_SQL.

History
Introduced in KCML 6.60
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_EXECUTE, 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_XML, KI_TABLES, KI_TABLESPACES
KCML database status codes