BuildFilterOperator
Description
Creates a nested QueryFilterNode Object that contains the specified Boolean operator.
This method
creates a nested node (or subnode) in the query expression. The newly created
node operates at the same level as the filters in the QueryFilterNode object
specified in the node parameter and is subject to the same conditions. You
can add filters to the newly created node using the BuildFilter method
just as you would for any other node.
Syntax
Perl
$node->BuildFilterOperator(bool_operator);
- Identifier
- Description
- node
- The QueryFilterNode object to which the newly created node will be attached.
- bool_operator
- A Long whose value is one of the BoolOp enumeration constants.
- Return value
- The newly created QueryFilterNode object.
Example
Perl
# query for (Owner = jsmith) AND (state = closed)
@owner = ("jsmith");
@state = ("closed");
$queryDef = $CQSession->BuildQuery("Defect");
@dbfields = ("ID","State","Headline");
foreach $field (@dbfields) {
$queryDef->BuildField($field);
}
$FilterNode1 = $queryDef->BuildFilterOperator($CQPerlExt::CQ_BOOL_OP_AND);
$FilterNode1->BuildFilter("Owner", $CQPerlExt::CQ_COMP_OP_EQ, \@owner);
$FilterNode1->BuildFilter("State", $CQPerlExt::CQ_COMP_OP_NOT_IN, \@state);
$resultSet = $CQsession->BuildResultSet($queryDef);
$resultSet->Execute;
$num_columns = $resultSet->GetNumberOfColumns;