From fc6f383bcb54af739ecf721f8c9990c05918a988 Mon Sep 17 00:00:00 2001 From: pijuskri Date: Mon, 29 Dec 2025 11:34:47 +0100 Subject: [PATCH 1/2] Remove unused mention of reserved OQL statement keywords that are now used --- content/en/docs/refguide/modeling/domain-model/oql/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/refguide/modeling/domain-model/oql/_index.md b/content/en/docs/refguide/modeling/domain-model/oql/_index.md index 47a0ab82755..ad3470b114f 100644 --- a/content/en/docs/refguide/modeling/domain-model/oql/_index.md +++ b/content/en/docs/refguide/modeling/domain-model/oql/_index.md @@ -85,5 +85,5 @@ In OQL, `FLOAT` is a reserved word for legacy reasons. Mendix no longer supports {{% /alert %}} {{% alert color="info" %}} -In OQL, `DELETE`, `INSERT`, `REPLACE`, `UPDATE`, `UPSERT`, `INTO`, `SET`, `VALUES`, `IGNORE`, `MATCHED`, `DUPLICATE`, `KEY`, `CONFLICT`, `MERGE`, `USING`, `SOURCE`, `TARGET`, and `WITH` are reserved but not yet used. +In OQL, `REPLACE`, `UPSERT`, `SET`, `VALUES`, `IGNORE`, `MATCHED`, `DUPLICATE`, `KEY`, `CONFLICT`, `MERGE`, `USING`, `SOURCE`, `TARGET`, and `WITH` are reserved but not yet used. {{% /alert %}} From a79d8efc050a55f9b2608a8a7c64265ab85044f6 Mon Sep 17 00:00:00 2001 From: pijuskri Date: Mon, 29 Dec 2025 14:06:23 +0100 Subject: [PATCH 2/2] Add section about OQL syntax basics --- .../docs/refguide/modeling/domain-model/oql/_index.md | 10 +++++++++- .../modeling/domain-model/oql/oql-expression-syntax.md | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/content/en/docs/refguide/modeling/domain-model/oql/_index.md b/content/en/docs/refguide/modeling/domain-model/oql/_index.md index ad3470b114f..7f241cbcd59 100644 --- a/content/en/docs/refguide/modeling/domain-model/oql/_index.md +++ b/content/en/docs/refguide/modeling/domain-model/oql/_index.md @@ -28,7 +28,15 @@ OQL queries do not take security into account out-of-the-box. This means that yo You can try your OQL example online in the [OQL Playground](https://service.mendixcloud.com/p/OQL) demo app. {{% /alert %}} -## Reserved Words {#reserved-oql-words} +## Syntax basics + +An OQL statement is made of [keywords](#reserved-oql-words), identifiers, [value literals](#oql-literals) and [operators](#oql-operators). + +Identifiers are used for module, entity, attribute, association, alias names and parts of names in paths. Identifier 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 `.`, `/`, `@`. + +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` or `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. + +### Reserved Words {#reserved-oql-words} 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`. diff --git a/content/en/docs/refguide/modeling/domain-model/oql/oql-expression-syntax.md b/content/en/docs/refguide/modeling/domain-model/oql/oql-expression-syntax.md index 995b8256f5d..0702ea87d6b 100644 --- a/content/en/docs/refguide/modeling/domain-model/oql/oql-expression-syntax.md +++ b/content/en/docs/refguide/modeling/domain-model/oql/oql-expression-syntax.md @@ -42,7 +42,7 @@ OQL supports a set of data types that differ slightly from [Mendix data types](/ | `LONG` | Integer/Long | 5 | 64 bit width integer data | | `STRING` | String | 'my_string' | Textual data | -## Literals +## Literals {#oql-literals} Literals represent values that are constant and are part of the query itself. The supported literals are detailed below: @@ -120,7 +120,7 @@ FROM Sales.Person ``` -## Operators +## Operators {#oql-operators} 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.