Skip to content

Commit 2ff93a9

Browse files
committed
Add section about OQL syntax basics
1 parent fc6f383 commit 2ff93a9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

content/en/docs/refguide/modeling/domain-model/oql/_index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ OQL queries do not take security into account out-of-the-box. This means that yo
2828
You can try your OQL example online in the [OQL Playground](https://service.mendixcloud.com/p/OQL) demo app.
2929
{{% /alert %}}
3030

31-
## Reserved Words {#reserved-oql-words}
31+
## Syntax basics
32+
33+
An OQL statement is made of [keywords](#reserved-oql-words), identifiers, [value literals](#oql-literals) and [operators](#oql-operators).
34+
35+
Identifiers are used for module, entity, attribute, association, alias names and parts of names in paths. Identifiers parts are only allowed to contain latin characters(`a-Z`), underscores(`_`) and numbers(`0-9`). Numbers can not be used as for the first character of an identifier. Identifiers can be wrapped in double quotes `" "` to also allow special characters `.`, `/`, `@`. An example
36+
37+
Multiple identifiers can be composed into a path, separated by special characters `.` and `/`. Both special characters can be used for indicating the module or attribute of an entity in the form `Module.Entity.Attribute` in OQL queries. In OQL statements, only the `.` special character can be used to indicate the statement entity. Both special characters can be used for separating associations in long paths. Examples of paths can be seen in the [OQL clauses](#longpath) page.
38+
39+
### Reserved Words {#reserved-oql-words}
3240

3341
Words with a specific purpose in OQL are reserved. If you use reserved words for entity, variable, or attribute names in an OQL query, they must be wrapped in double quotes `" "`. For example, in the OQL query `SELECT AVG(TotalPrice) FROM Sales."Order" WHERE IsPaid = 1`, `Order` needs to be wrapped in quotes because it is a reserved word, as it can be used to `ORDER BY`.
3442

content/en/docs/refguide/modeling/domain-model/oql/oql-expression-syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ OQL supports a set of data types that differ slightly from [Mendix data types](/
4242
| `LONG` | Integer/Long | 5 | 64 bit width integer data |
4343
| `STRING` | String | 'my_string' | Textual data |
4444

45-
## Literals
45+
## Literals {#oql-literals}
4646

4747
Literals represent values that are constant and are part of the query itself. The supported literals are detailed below:
4848

@@ -120,7 +120,7 @@ FROM
120120
Sales.Person
121121
```
122122

123-
## Operators
123+
## Operators {#oql-operators}
124124

125125
Operators perform common operations and, unlike functions, do not put their parameters in parentheses. They take `expression` as input, which can be other operator results, functions, columns and literals.
126126

0 commit comments

Comments
 (0)