KI_SET_COL_LIST
Argument | Enumeration | Purpose |
---|---|---|
handle | Handle | |
collist$ | Comma separated list of columns | |
status | KDB_ERROR_ENUM | Return status |
KI_SET_COL_LIST
This allows a program to specify in a comma separated list the columns of interest in a read or write operation on the table's handle. Only these columns will be retrieved from the Oracle database server thus reducing overhead for binding and network bandwidth when fetching data. The other columns in the row buffer that are not included in this list will not be altered in a read or updated on a write.
This function should be issued before a start or random read operation. It stays in effect only for that operation and any sequential reads done on a result set generated by the operation. Column IPREFIXes are optional.
In general DEFVIEW provides a better mechanism for defining the columns of interest in a row as the compiler can check that only the view columns in the row buffer are referenced in the code. KI_SET_COL_LIST provides a way for an ad hoc result set to be dynamically generated based on user input. Examples might be report generator and query programs where the columns of interest are not known in advance.
In this example the columns in a DEFVIEW are converted to a comma separated list and applied to a handle
DEFVIEW test1_view OF test1 FLD empno$ FLD esalary END VIEW DIM fldspec$(1)0, cols, collist$0, len,i,s cols = '_Enum_test1_view(BYREF fldspec$()) len = 0 FOR i = 1 TO cols len += LEN(RTRIM(FLD(fldspec$(i).defrecord_name$))) + 1 NEXT i MAT REDIM collist$len i = 2 collist$ = FLD(fldspec$(1).defrecord_name$) WHILE i <= cols DO collist$ = & "," & FLD(fldspec$(i).defrecord_name$) i++ WEND CALL KI_SET_COL_LIST h, collist$ TO s IF (s <> 0) THEN 'handle_error(h, s)
If the list is blank then all columns are used in read and write operations. There can be at most 1024 columns in the list.
The list can be retrieved with KI_GET_COL_LIST.
Compatibility
Introduced in KCML 6.60 and effective only with Oracle. It is available in 6.20 as a stub function which has no effect and always returns KE_SUCCESS.