KI_DESCRIBE_COL
Argument | Enumeration | Purpose |
---|---|---|
hTable | Handle | |
nCol | Column number (from 1) | |
SYM(r$) | Symbol of KDB_COLUMN record | |
sName$ | Name | |
sDataType$ | SQL data type | |
sPack$ | Packing as in $FORMAT | |
nOffset | Offset (from 1) | |
status | KDB_ERROR_ENUM | Return status |
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
Name | Purpose |
---|---|
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" |
nOffset | The 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.