views:

85

answers:

1

I'm having trouble setting up a filter for a query in cqperl. I'm trying to build a pretty simple filter to query based on a defect id, but I'm getting the following error: Failed condition: AdIsValidCompOp (op).

The code is as follows:

my $querydef = $session -> BuildQuery("defect");
my @dbfields = ("id", "headline", "owner.login_name");

my $field;

foreach $field (@dbfields)
{
    $querydef -> BuildField($field);
}

my $operator = $querydef -> BuildFilterOperator($CQPerlExt::CQ_BOOL_OP_AND);

my @id = ("PPSCR00681534");

$operator->BuildFilter("id", $QPerlExt::CQ_COMP_OP_EQ, \@id);

my ($result_set) = $session -> BuildResultSet($querydef);

The error occors in "BuildResultSet".

Thanks.

A: 

I figured it out. I had a typo in the code:

$operator->BuildFilter("id", $QPerlExt::CQ_COMP_OP_EQ, \@id);

should have been:

$operator->BuildFilter("id", $CQPerlExt::CQ_COMP_OP_EQ, \@id);

Scott Turley