skip to main content
OpenAccess SDK SQL Engine core methods for Java : Exchanging data : dam_getFirstCol
 

dam_getFirstCol

This method is used to navigate through the columns that appear in the SELECT, UPDATE and WHERE clause of the SQL query or through the columns in the schema definition of the table. Call this method, with the column types to be navigated, and then use dam_getNextCol to step through the list.
The dam_getFirstCol method is used to:
*Write an IP that is dynamic in that it does not hard-code any column names.
*Optimize an IP where it first builds a row with only the columns in the WHERE clause and then adds the columns in the SELECT or UPDATE part only if dam_isTargetRow returns TRUE.
long dam_getFirstCol(
     long hstmt,
     int  iColType)
Table 172. Parameters for dam_getFirstCol
Parameter
Type
Description
INPUT
hstmt
long
The statement handle.
iColType
int
Identifies the column list to navigate. Use a bitwise OR ( | ) one of the following flags to scan through columns that are in multiple categories:
DAM_COL_IN_SCHEMA - list of all columns as defined in the schema database.
DAM_COL_IN_RESULT - list of columns that are part of the result set.
DAM_COL_IN_CONDITION - list of columns that are in the WHERE clause.
DAM_COL_IN_UPDATE_VAL_EXP - list of all columns that are part of update value expressions.
DAM_COL_IN_USE - list of columns that are either part of the result or are in the WHERE clause. The row passed to dam_addRowToTable must include at minimum all the columns in this list.
RETURN
long
The handle to the first column that has the attributes of iColType; otherwise, 0.

See also

*dam_addRowToTable
*dam_getNextCol
*dam_isTargetRow