query command

Use the query command to search for objects in the database. Rational® Synergy evaluates a query expression during a search operation. The query expression can consist of any query clause from query-related options combined with any query_string argument. The results of the query display in the selection set.

By default, the query sorts objects using sorting criteria, which is described in Sorting and grouping.

If you do not specify a query expression using query-related options or a query_string argument, the command shows the current selection set and applies any sorting, then updates the selection set.

Query functions and sorting

To use a query function with sorting (for example, recursive_is_member_of ), the query function sorting order is applied to the final result if -no_sort is specified, and if that query function is not combined with other query operators to make a compound query.

Selection set ordering and use

By default, the output is numbered to show the selection set reference number. You can then reference specific objects in the selection set by using the selection set reference syntax (for example, @1). See Query selection set reference forms for details.

Query expression construction

The command supports a number of options for constructing a query expression. For example, the -name option provides an alternative way of constructing a query clause of the type name='name'.

If such an option is repeated, the corresponding query clauses are combined with an or. For example, -n joe -n ann results in a query clause (name='joe' or name='ann').

Query clauses for different options are combined with an and. For example, -n joe -s working results in a query clause (name='joe') and (status='working').

These constructed query clauses are combined with any specified query_string argument with an and. For example, -n joe "is_hist_leaf()" results in a query expression of (name='joe') and (is_hist_leaf()).


Feedback