Query General Syntax: Select
Query notation
Query uses the following notation:
An expression within square brackets [ ] is optional.
An expression within brackets ( ) can be repeated.
Expressions within braces { } are alternative choices.
The ERQL operators are in bold characters.
Query structure
The syntax of a query is structured as follows:
Select MetaClass from @set Into @Result Where Condition
You must use the operators "From", "Into" and "Where" in the order indicated in the example above.
Queries are not case-sensitive. Object types and attributes can be entered with or without accents.
*MetaClasses containing blanks must be entered within square brackets ([ ]).
Query comments
You can insert comments into commands by starting these with “/*” and finishing with “*/”.
Example: select Message /* Query for messages */
Query settings
You can use settings to specify conditions for a query. When you execute this query, a dialog box asks you to enter these settings, with a box for each setting defined in the query.
Setting names are preceded by &. The setting name is used as the title for the field you are asked to complete when specifying the setting value.
In the syntax description, “&setting” indicates that you can define a setting.
select Message where type-message = &Type
When the setting is processed, you will be prompted for the value of the "Type" field.
The setting name can contain any character if it is between “ “.
“&Org-Unit Name“
Queries containing several selects
You can use several "Select" clauses in the same query. "Select" clauses follow the same rules as queries that have only one clause. The only difference is that the name specified after the "From" operator can match the result ("Into") of a previous "Select" clause.
This allows you to use intermediate results without having to save them.
Note that the intermediate results are not saved; only the last result is displayed on completion of query execution.
*You can put “Select” clauses on different lines. When entering the query, you can insert a line break by pressing the <Ctrl> and <Enter> keys simultaneously.
Examples:
Find the material flows of a project:
Select Message into @MaterialFlow where Flow-Type = “Material Flow”
Select from @MaterialFlow where Diagram.Project = &project
Find the messages of the project diagrams that describe an org-unit:
Select Diagram into @Org-UnitDiagram where Described-Org-Unit and Project = &project
Select Message where Diagram in @ DiagramOrg-Unit