Define a WHERE clause in a text editor

A WHERE clause consists of the object class property, the operator defining the compare mode, and the value with which the object class property is compared:

  • WHERE
  • Application.Name LIKE ’A%’

You can define a WHERE clause that checks whether the value of an object class property is identical to the value of another object class property.

To compare two properties in the Alfabet query language as text, the value of the WHERE clause must be specified as ObjectClassName.PropertyName. The value is not written in inverted commas.

The following WHERE condition defines that only applications with an end date after the end date of the assigned ICT object are displayed in the report:

  • WHERE
  • Application.EndDate > ICTObject.EndDate

You can add multiple WHERE conditions to the WHERE clause of an Alfabet query. When you do so, you must specify in the WHERE clause whether the WHERE conditions are AND or OR related:

AND: Returns True when all expressions are true.

OR: Returns True when at least one expression is true.

More than two WHERE conditions can be related with each other in an AND or OR relationship.

You can combine multiple AND and OR conditions hierarchically. For example, you can define that condition A and either condition B or condition C should apply.

All WHERE conditions of an Alfabet query are written in the same WHERE clause. It is not allowed to specify multiple WHERE clauses in an Alfabet query.

In the Alfabet query language, multiple WHERE conditions in an Alfabet query are defined as:

  • WHERE
    • (AND|OR
      • Condition1
      • Condition2
    • )

The expression:

  • WHERE
    • (AND
      • Application.ResponsibleUser IS NULL
      • Application.Status = ’Approved’
    • )

finds all applications with the status Approved and no responsible user assigned.

The combination of AND or OR relations results in a code like the following:

  • WHERE
    • (AND|OR
      • Condition1
      • (AND|OR
        • Condition2
        • Condition3
      • )
    • )