Types of queries

There are two types of queries in BMC Client Management:

Predefined, criteria-based queries

Queries are composed of criteria which tell the agent on the target devices what to check for. The criteria available to the query depend on the type of the query, thus not all existing criteria are available all the time. The Criteria tab displays information about the criteria of the selected query and is only visible if the selected query is a criteria-based query.

The following table explains the different elements of the Criteria tab:

Name

Description

Query Status

This field displays the status of the query. When a query is newly created it will automatically become active . When a query is modified in any way, that is, criteria are added, removed or modified, the Query Operator is changed or the Reverse Query Result parameter is checked or unchecked, the query automatically becomes inactive . This means that all groups, device and user, to which the query is currently assigned will not re-evaluate their members anymore. This also means that any report of which at least one subreport is based on this query, or which is assigned to a group with this query will not be executed. After the query modification finished you must manually reactivate the query by selecting active from the list.

Query Operator

The boolean operator is active only in case of a multiple selection and defines the relationship between the individual criteria selected for the query. All criteria of a query are connected with the same operator. Possible values are:

  • AND
    When selecting this operator, the result of the query will provide you with objects that fulfil ALL criteria defined for the query. For the AND operator an INNER JOIN is used. for example, the criteria defined are: Device Name contains 1 AND Device Name contains 2. The result will only display devices of which the name contains either the number combination 12 or 21, such as France 123 or UK 210. Devices with a name like French 1 and French 2 will not be included. This option is the default value.
  • OR
    This operator defines a query where only one of all criteria defined must be fulfilled to be part of the result. For the OR operator a LEFT OUTER JOIN is used. The result for the same example as mentioned in the preceding paragraph with the OR operator would contain devices with names such as France 1, France 2, Device 12 and Device632.

Reverse Query Result

Check this box, to display the reversed results of the query. In this case the result will contain all objects which do not correspond to the selected criteria.

Category

The fields in this column display the category to which the selected criterion belongs to. The existing categories are the same as the query types.

Attribute

This field displays the name of the criterion. The Parent Name attribute returns the devices which are directly below the respective parent. If your hierarchy contains several cascading relay levels a Parent Name attribute/criterion must be added for each relay, to take into account all devices. For this case select OR as the operator.

Operator

The fields in this column display the selected operator, which may be one of the following: Contains , Ends with , Equal to , Greater than , Greater than or equal , Less than , Less than or equal , Like (SQL) , Not equal to , Not like (SQL) , Starts with , Is Null and Is Not Null .

Value

This field displays the value defined for the attribute.

Reverse Criterion Result

If the result of the criterion definition is to be reversed this field indicates Yes .If the criterion defines for example to find all devices on which Microsoft IE is installed and this option is activated, the final result of this criterion will be all devices on which IE is not installed.

Free SQL queries

Free SQL queries can be entirely freely composed of SQL syntax according to your requirements. It can be assigned to populate device groups and be used as the base for subreports, also they can be selected as static and dynamic objects within administrator or group security profiles. Contrary to criteria-based queries this type of query is always active. The SQL tab displays information about the selected query and is only visible if the selected query is a free SQL query.

The following table explains the different elements of the SQL tab:

Name

Description

Query Status

This field displays the status of the query. When a query is newly created it will automatically become active . When a query is modified in any way the query automatically becomes_inactive_ . This means that all groups, device and user, to which the query is currently assigned will not re-evaluate their members anymore. This also means that any report of which at least one subreport is based on this query, or which is assigned to a group with this query will not be executed. After the query modification finished you must manually reactivate the query by selecting active from the list.

SQL Query

You can directly enter into this text box your SQL query.

Note:

Be aware of the following specifications when creating your free SQL query:

The query must start with SELECT.
The FROM must include the base table linked to the query type: if the type is Device , the query need to include the Device table.
The query cannot include the following operators: COUNT, SUM, AVERAGE, MAX, MIN, and SQL commands such as UNION, INTERSECT, EXCEPT, MINUS, and so on.

SQL Result

This text box displays the result of the query syntax verification.

Was this page helpful? Yes No Submitting... Thank you

Comments