Expr2Type property: QueryCriteria class
Description
This property returns or sets the type for Expression 2. The following table lists all of possible values for this property. However, the values for this property are dependent upon the Operator property.
This property is read/write.
See Operator property: QueryCriteria class, Working With Query Criteria and Expressions.
You can use either a constant or numeric value for this property. The values are:
| Numeric Value | Constant Value | Description |
|---|---|---|
|
1 |
%Query_ExprConstant |
Constant |
|
2 |
%Query_ExprField |
Field |
|
3 |
%Query_Exprression |
Expression |
|
4 |
%Query_ExprSubQuery |
Subquery |
|
5 |
%Query_ExprList |
List |
|
6 |
%Query_ExprCurDt |
Current date |
|
7 |
%Query_ExprTree |
Tree |
|
8 |
%Query_ExprBind |
Bind |
|
9 |
%Query_ExprBothConst |
The criterion's operator is Between and both values on the right-hand side are constants. (Const-Const) |
|
10 |
%Query_ExprConstFld |
The criterion's operator is Between, the first value on right-hand side is a constant and the second value is a field. (Const-Field) |
|
11 |
%Query_ExprConstExpr |
The criterion's operator is Between, the first value on right-hand side is a constant and the second value is an expression. (Const-Expr) |
|
12 |
%Query_ExprFieldConst |
The criterion's operator is Between, the first value on right-hand side is a field and the second value is a constant. (Field-Const) |
|
13 |
%Query_ExprBothFld |
The criterion's operator is Between and both values on the right-hand side are constants. (Field-Field) |
|
14 |
%Query_ExprFldExpr |
The criterion's operator is Between, the first value on right-hand side is a field and the second value is an expression. (Field-Expr) |
|
15 |
%Query_ExprExprConst |
The criterion's operator is Between, the first value on right-hand side is an expression and the second value is a constant. (Expr-Const) |
|
16 |
%Query_ExprExprFld |
The criterion's operator is Between, the first value on right-hand side is an expression and the second value is a field. (Expr-Field) |
|
17 |
%Query_ExprBothExpr |
The criterion's operator is Between and both values on the right-hand side are expressions. (Expr-Expr) |
|
18 |
%Query_ExprTreePrompt |
Tree prompt |
The following table describes how to access or change Expression 2 depending on the Expression2 Type.
| Expression2 Type | Method or Property for Changing the Expression | Method or Property for Accessing the Expression |
|---|---|---|
|
Constant |
Expr2Constant |
Expr2Constant |
|
Field |
AddExpr2Field() |
Expr2Field |
|
Expression |
AddExpr2Expression() |
Expr2Expression |
|
In List |
AddExpr2List |
Expr2List |
|
In Tree |
AddExpr2Expression |
Expr2Expression |
|
Subquery |
AddExpr2Subquery() |
Expr2Subquery |
|
Const-Const |
Expr2Constant, Expr2Constant |
Expr2Constant, Expr2Constant |
|
Const-Field |
Expr2Constant, AddExpr2Field() |
Expr2Constant, Expr2Field |
|
Const-Expr |
Expr2Constant, AddExpr2Expression() |
Expr2Constant, Expr2Expression |
|
Field-Const |
AddExpr2Field(), Expr2Constant |
Expr2Field, Expr2Constant |
|
Field-Field |
AddExpr2Field(), AddExpr2Field() |
Expr2Field, Expr2Field |
|
Field-Expr |
AddExpr2Field(), AddExpr2Expression() |
Expr2Field, Expr2Expression |
|
Expr-Const |
AddExpr2Expression(), Expr2Constant |
Expr2Expression, Expr2Constant |
|
Expr-Field |
AddExpr2Expression(), AddExpr2Field() |
Expr2Expression, Expr2Field |
|
Expr-Expr |
AddExpr2Expression(), AddExpr2Expression() |
Expr2Expression, Expr2Expression |
Example
The following is used to test the expression to determine the property to use to retrieve it:
&MyExpr2 = &MyCriteria.Expr2Expression;
If &MyExpr2.Expr2Type = %Query_ExprConstant Then /* Expression is a constant */
&OldValue = &MyExpr2.Expr2Constant;
/* do processing */
End-if;
The following is an example showing how to add a field for Expression 2:
( )
/* After setting the first expression, set the operator for the criteria*/
&MyCriteria.Operator = %Query_CondEqual;
/* Set the type of the second expression to be a field */
&MyCriteria.Expr2Type = %Query_ExprField;
/* Add the EMPLID field from the ABSENCE_HIST record whose record alias is A */
&MyField = &MyCriteria.AddExpr2Field("A", "EMPLID" );