A nested query is a query expression that uses a function
test, where one or more of the arguments is an object_name or project_name that
is a query expression.
Query functions usually have the following syntax:
query_function('object_name'|
'project_name'|
'type_name'|
'attr_name'|
'privilege_name'
[,sort_order])
Query function arguments that do not represent objects or projects
cannot be specified as a nested query expression.
Replace any object name, project name, or type name argument with
any query expression that evaluates to zero or more objects of the
appropriate type. Queries can be nested to any wanted depth.
Example
- Find all members of all projects named editor.
>
ccm query "is_member_of(cvtype='project' and name='editor')"
- Find all version 1.0 projects that have the same members as project toolkit-1.0.
>
ccm query "has_member(is_member_of('1/project/toolkit/1.0')) and version
= '1.0'"
- Find all subprojects in all projects named editor,
using the fastest search method by specifying "none".
>
ccm query "hierarchy_asm_members(cvtype='project' and name = 'editor',
'none')"
- Find all objects that have object save.c-1 of
type csrc as their predecessor.
> ccm query
"has_predecessor(cvtype='csrc' and name='save.c' and version='1')"
- Find all objects used in directory sources-1 in
the project editor-fcheng.
> ccm query
"is_child_of('sources-1:dir:1', cvtype='project' and name='editor'
and version='fcheng')"
- Find all projects containing objects associated with tasks, for
which the release of the tasks values are set to 1.0.
>
ccm query "has_member(is_associated_cv_of(cvtype='task' and release='1.0'))"Note: When
you construct a query expression in the Query dialog
box, do not enclose the outer query expression in double quotation
marks.