skip to main content
OpenAccess SDK SQL Engine core methods for .NET : Methods for .NET reference : dam_describeCond
 

dam_describeCond

This method is used to retrieve the description of the condition. Use this method to retrieve the condition ( =, >, <, etc.) and the value of the operand is ('TAG', 100, etc.). The condition is returned as a left and right pair. The right part only applies in the case of BETWEEN or LIKE type of conditions. For other conditions, when the right part is requested, a value of 0 is returned for the operator type. Each condition is described by the operator type, the value of the operand, and the data type of the operand value. You must use the method dam_getCondVal and/or dam_getCondRightVal to get the data for the condition.
int dam_describeCond(
int64 hcond,
out int piLeftOpType,
out int piLeftXOType,
out int piRightOpType,
out int piRightXOTpe)
 
Table 108: Parameters for dam_describeCond 
Parameter
Type
Description
IN
 
 
hcond
int64
The condition handle
OUT
 
 
piLeftOpType
out int
The left operator type. See Table 109 for the operators and the associated value. All conditions always have a left value.
piLeftXOType
out int
The data type.
piRightOpType
out int
The right operator type. See Table 109 for the operators and the associated value. This value is only present in BETWEEN and LIKE type of statements. A value of 0 is returned if there is no right value.
piRightXOType
out int
The data type.
RETURN
 
 
 
int
DAM_SUCCESS – valid condition returned
DAM_FAILURE – an error occurred while getting a condition because the arguments to the call are invalid or the format of the data in the condition cannot be converted to the column type.
The following table shows the operators that are allowed in a condition. Refer to "Default optimization" in Chapter 4 of OpenAccess SDK SQL Engine Programmer’s Guide for examples on the operator values returned by this method to describe conditions like VALUE>=xxx and VALUE BETWEEN xxx AND yyy.
 
Table 109: Operator types for conditions 
Operator
Description
SQL_OP_SMALLER
The column value should be smaller than. This bit is set if <, <=, or BETWEEN predicates are used in the SQL query.
SQL_OP_GREATER
The column value should be greater than. This bit is set if >, >=, or BETWEEN predicates are used in the SQL query.
SQL_OP_LIKE
The column value should be LIKE. The ppRightData will contain a valid pointer to XO_TYPE_CHAR data if an ESCAPE clause was used with LIKE.
SQL_OP_ISNULL
The column value should be NULL.
SQL_OP_EQUAL
The column value should be equal. This bit is set if <=, >=, or BETWEEN predicates are used in the SQL query.
SQL_OP_NOT
This operator occurs always in combination with either SQL_OP_NULL or SQL_OP_EQUAL and implies that the column value should not be NULL and column value should not be EQUAL respectively.

See also 

dam_describeCondEx
dam_getCondVal
dam_getCondRightVal