BuildFilterOperator
Description
Creates the top-level QueryFilterNode Object for the query.
This QueryDef method is the starting-point for building a query expression. You must call this method to obtain the first filter in the query expression. From this filter, you can construct additional filters to specify the criteria you want. The query expression is constructed as a tree of Boolean operators. The tree is not necessarily binary; you can add more than two conditions to a filter node.
Syntax
Perl
$querydef->BuildFilterOperator(bool_operator);
- Identifier
- Description
- querydef
- A QueryDef object.
- bool_operator
- A Long whose value is one of the BoolOp constants.
- Return value
- The newly created QueryFilterNode object.
Example
Perl
@owner = ("jsmith");
@state = ("closed");
$queryDef = $CQsession->BuildQuery("defect");
@dbfields = ("ID","State","Headline");
foreach $field (@dbfields) {
$queryDef->BuildField($field);
}
$operator = $queryDef->BuildFilterOperator($CQPerlExt::CQ_BOOL_OP_AND);
$operator->BuildFilter("Owner", $CQPerlExt::CQ_COMP_OP_EQ,\@owner);
$operator->BuildFilter("State", $CQPerlExt::CQ_COMP_OP_NOT_IN, \@state);