add query NAME [user USER_NAME] {ITEM}; |
NAME
is the
name of the query you are defining. The query name cannot include asterisks.
When assigning a name to the saved query, you cannot have the same name for two queries. If you use the name again, an error message will result. However, several different users could use the same name for different queries, since queries are local to the context of individual users.
For example, several users could each have a query called Current Project. But the contents of each Current Project query could differ from user to user depending on the individual needs of each person. As the user adds business objects regarding Current Project, contents can change also. If you change context from one user to another, evaluating the Current Project query will most likely produce different results.
USER_NAME
can be included with the user keyword if you are a business administrator with person access defining a query for another user. If not specified, the query is part of the current user’s workspace.
{ITEM}
defines what you are searching for. You can include any or all of the following:
businessobject TYPE_PATTERN PATTERN REVISION_PATTERN |
[!|not] hidden |
owner PATTERN |
vault PATTERN |
[!|not] expandtype |
visible USER_NAME{,USER_NAME}; |
where QUERY_EXPR |
property NAME [to ADMINTYPE NAME] [value STRING] |
None of these clauses is required. The default is an asterisk (*), indicating
that the query will find all business objects in the database.
Most of these clauses use
PATTERN
rather than
NAME
values. This offers greater flexibility in specifying possible name values. Patterns enable you to use wildcard characters and to list multiple values when specifying a name.
The most commonly used wildcard character in queries is the asterisk (*). If only an asterisk is used for the
PATTERN
, all definitions for that field will be searched. When an asterisk is inserted into a name, it acts as a substitute for a group of letters. This group can contain many letters or none. For example, if you specify a business object name as
Ca*
, you might find objects named Catalogue93, CadDrawingA49, CaseLog, Ca668, and so on. All objects that begin with the letters “Ca” are searched for and any that are found appear in a list. If you enter a value of
dr*t
, you will find all objects whose names begin with “dr” and end in “t.”
In this sample query definition below, all objects that start with the letters A, B, and C are searched for. Each of the other clauses uses only an asterisk for a value. The search includes all vaults and all owners. To restrict the search further, you could include specific values in those clauses.
add query “Name Search”
businessobject * A*,B*,C* *
vault *
owner *; |
The first and last asterisks (*) in the Businesobject clause indicate that all types and revisions should be included.
The following sections explain how each Add Query clause is used to filter out and locate desired business objects.