Evaluate Query

Once a query is defined, you need to evaluate it, using the Evaluate Query command, to find the information.

evaluate query NAME;

When a query is evaluated, all business objects that meet the search criteria are displayed in the window or listed on your screen. If you want to save this collection of objects, you can assign a set name to it and reference the set name when you want to view the collection.

Saving query results as a set can be useful when you have a changing environment. Even when you use the same query, it is possible that you would get different results if the objects are undergoing change. Therefore, to save query results for a later time, you should place them in a set.

Use the Evaluate Query command to process the query and optionally save the results of a query in a set. This command contains the following optional clauses:

into set SET_NAME
onto set SET_NAME
over set SET_NAME into|onto
querytrigger
  • QUERY_NAME is the name of the query to be used.
  • SET_NAME is the name to be assigned to the collection of objects created by the query.

Evaluate Query Optional Clauses Specifies
INTO If the named set exists, the set is cleared and the results of the current query is placed into the set. If the named set does not exist, the set is created and the results are placed into it.
ONTO If the named set exists, the results of the current query are added to the set contents. If the named set does not exist, the set is created and the results are placed into it.
OVER Performs a find on an existing set.
querytrigger Executes the program named ValidateQuery, even if triggers are turned off.

If the INTO or ONTO form of the Evaluate Query command is used, the found set is not listed on the screen. To view them, you must print the set. If you only evaluate the query and do not save onto or into a set, the found values are listed on the screen. For example:

add query sarah where ‘type==drawing’;
print query sarah;
query sarah
   businessobject * * *
   vault *
   owner *
   where 'type==Drawing'
eval query sarah;
Drawing test A
Drawing ttest A
Drawing 726602 A
Drawing 726601 A
Drawing 726600 A
Drawing 726596 B
Drawing 726595 A
Drawing 726594 A
Drawing 726593 A
Drawing 726592 A
Drawing 726591 C
Drawing 726590 B
Drawing 50234 F
Drawing 50225 D
Drawing 50461 B
Drawing 50023 F
Drawing 50403 B
eval query sarah into set sarah;
print set sarah;
set sarah
   member businessobject Drawing test A
   member businessobject Drawing ttest A
   member businessobject Drawing 726602 A
   member businessobject Drawing 726601 A
   member businessobject Drawing 726600 A
   member businessobject Drawing 726596 B
   member businessobject Drawing 726595 A
   member businessobject Drawing 726594 A
   member businessobject Drawing 726593 A
   member businessobject Drawing 726592 A
   member businessobject Drawing 726591 C
   member businessobject Drawing 726590 B
   member businessobject Drawing 50234 F
   member businessobject Drawing 50225 D
   member businessobject Drawing 50461 B
   member businessobject Drawing 50023 F
   member businessobject Drawing 50403 B