KI_DESCRIBE_COL

Describe a column

Synopsis:
CALL KI_DESCRIBE_COL hTable, nCol, [SYM(r$)] TO [sName$], [sDataType$], [sPack$], [nOffset], status
status = 'ki_describe_col( hTable, nCol, [SYM(r$)], sName$, sDataType$, sPack$, nOffset )
ArgumentEnumerationPurpose
hTableHandle
nColColumn number (from 1)
SYM(r$)Symbol of KDB_COLUMN record
sName$Name
sDataType$SQL data type
sPack$Packing as in $FORMAT
nOffsetOffset (from 1)
statusKDB_ERROR_ENUMReturn status
>KI_DESCRIBE_COL

KI_DESCRIBE_COL

This function can be used to describe the columns of a result set from a query compiled by a call to KI_PREPARE. This can be performed even before the query is executed. Columns are counted from 1. The number of columns in a result set can be discovered from the colcount return value in KI_PREPARE. The description available is passed back in the variables

NamePurpose
sName$The column name
sDataType$The SQL datatype e.g. VARCHAR(10)
sPack$The datatype in a form that can be used in a $PACK or $FORMAT statement e.g. "B3"
nOffsetThe offset of the column in the row buffer. This is counted from 1.

By passing the SYM of a KDB_COLUMN record as the optional third argument the record can be filled in with more information about the column. THis is the same record as used in KI_COLUMNS. Pass a zero or leave out this argument if you do not want this extra information.

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_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, KI_SQL_XML, KI_TABLES, KI_TABLESPACES
KCML database status codes