From 67970573cc20b481d0a64d10bda4e3cc8dc6f415 Mon Sep 17 00:00:00 2001 From: Augusto Passalacqua Date: Thu, 16 Apr 2026 16:56:28 +0200 Subject: [PATCH 1/6] Document TRIM, RTRIM and LTRIM OQL functions --- .../domain-model/oql/oql-expression-syntax.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) 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 afce4e213a1..0e04ebc9677 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 @@ -692,10 +692,13 @@ These are the currently supported functions: * LENGTH * LOCATE * LOWER +* LTRIM * RANGEBEGIN * RANGEEND * REPLACE * ROUND +* RTRIM +* TRIM * UPPER ### CAST{#cast} @@ -1329,6 +1332,41 @@ SELECT * FROM Sales.Customer WHERE LOWER(LastName) = 'doe' This query can no longer take advantage of an index for `LastName` for comparison, resulting in a performance decrease. {{% /alert %}} +### LTRIM{#ltrim} + +Removes leading characters from a `string`. If no `character` is specified for trimming, space is used. + +#### Syntax + +The syntax is as follows: + +```sql +LTRIM ( expression [, character ] ) +``` + +##### expression + +`expression` is any string expression to be trimmed. If `expression` is `NULL`, the function will return `NULL`. + +##### character + +`character` is an optional single character string expression containing the character to trim. If omitted, the space character is used instead. + +{{% alert color="info" %}} +Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. +{{% /alert %}} + +#### Examples + +```sql +SELECT LTRIM(LastName, 'D') FROM Sales.Order WHERE Price = 1.50000001 +``` + +| LastName | +|:---------| +| oe | +| Moose | + ### Ranges in Datasets {{% alert color="info" %}} @@ -1507,6 +1545,41 @@ SELECT ROUND((Price : 7), 2) as RoundedPrice, Price : 7 FROM Sales.Order | 0.33 | 3.33333333 | | 1.17 | 1.17142857 | +### RTRIM{#rtrim} + +Removes trailing characters from a `string`. If no `character` is specified for trimming, space is used. + +#### Syntax + +The syntax is as follows: + +```sql +RTRIM ( expression [, character ] ) +``` + +##### expression + +`expression` is any string expression to be trimmed. If `expression` is `NULL`, the function will return `NULL`. + +##### character + +`character` is an optional single character string expression containing the character to trim. If omitted, the space character is used instead. + +{{% alert color="info" %}} +Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. +{{% /alert %}} + +#### Examples + +```sql +SELECT RTRIM(LastName, 'e') FROM Sales.Order WHERE Price = 1.50000001 +``` + +| LastName | +|:---------| +| Do | +| Moos | + ### SUBSTRING{#substring-function} #### Description @@ -1559,6 +1632,41 @@ ORDER BY LastName LIMIT 1 |:-------------|:---------------|:----------------|:-----------------| | logical | logic | logical | *(empty string)* | +### TRIM{#trim} + +Removes leading and trailing characters from a `string`. If no `character` is specified for trimming, space is used. + +#### Syntax + +The syntax is as follows: + +```sql +TRIM ( expression [, character ] ) +``` + +##### expression + +`expression` is any string expression to be trimmed. If `expression` is `NULL`, the function will return `NULL`. + +##### character + +`character` is an optional single character string expression containing the character to trim. If omitted, the space character is used instead. + +{{% alert color="info" %}} +Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. +{{% /alert %}} + +#### Examples + +```sql +SELECT TRIM(TRIM(LastName, 'e'), 'D') FROM Sales.Order WHERE Price = 1.50000001 +``` + +| LastName | +|:---------| +| o | +| Moos | + ### UPPER Converts all lowercase characters in a given string to uppercase. Opposite of [LOWER](#lower-function). From 305c9c93ef7478afc35369af33350c0d75d683c1 Mon Sep 17 00:00:00 2001 From: Augusto Passalacqua Date: Thu, 30 Apr 2026 17:08:12 +0200 Subject: [PATCH 2/6] Update the minimum compatibility mode for Azure SQL Server to 160 (equivalent to 2022) for Mendix 11 --- content/en/docs/refguide/installation/system-requirements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/refguide/installation/system-requirements.md b/content/en/docs/refguide/installation/system-requirements.md index 751205c078d..e467aa9bd0e 100644 --- a/content/en/docs/refguide/installation/system-requirements.md +++ b/content/en/docs/refguide/installation/system-requirements.md @@ -254,7 +254,7 @@ Current support: * [MariaDB](/refguide/mysql/): 10.6, 10.11, 11.4, 11.8 * [Microsoft SQL Server](/developerportal/deploy/mendix-on-windows-microsoft-sql-server/): 2022, 2025 -* [Azure SQL](https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level?view=sql-server-2017): v12 compatibility mode 140 or higher +* [Azure SQL](https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level?view=sql-server-ver17): v12 compatibility mode 160 or higher * [MySQL](/refguide/mysql/): 8.4 * [Oracle Database](/refguide/oracle/): 19, 21c, 23ai (including 26ai) * PostgreSQL: 13, 14, 15, 16, 17, 18 From 893bf3fdcdd58b98d9049bf93643c2051b03c288 Mon Sep 17 00:00:00 2001 From: MarkvanMents Date: Wed, 6 May 2026 16:25:22 +0200 Subject: [PATCH 3/6] Add information to TRIM functions. --- .../domain-model/oql/oql-expression-syntax.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) 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 0e04ebc9677..40e56b8c52c 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 @@ -1336,6 +1336,10 @@ This query can no longer take advantage of an index for `LastName` for compariso Removes leading characters from a `string`. If no `character` is specified for trimming, space is used. +{{% alert color="info" %}} +This function was introduced in Mendix version 11.11.0. +{{% /alert %}} + #### Syntax The syntax is as follows: @@ -1356,6 +1360,10 @@ LTRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} +{{% alert color="info" %}} +Like with other String functions, case sensitivity of the `LOCATE` function depends on the database. See [Behavior of Case Sensitivity by Database Type](/refguide/case-sensitive-database-behavior/#behavior-of-case-sensitivity-by-database-type) for details. +{{% /alert %}} + #### Examples ```sql @@ -1549,6 +1557,10 @@ SELECT ROUND((Price : 7), 2) as RoundedPrice, Price : 7 FROM Sales.Order Removes trailing characters from a `string`. If no `character` is specified for trimming, space is used. +{{% alert color="info" %}} +This function was introduced in Mendix version 11.11.0. +{{% /alert %}} + #### Syntax The syntax is as follows: @@ -1569,6 +1581,10 @@ RTRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} +{{% alert color="info" %}} +Like with other String functions, case sensitivity of the `LOCATE` function depends on the database. See [Behavior of Case Sensitivity by Database Type](/refguide/case-sensitive-database-behavior/#behavior-of-case-sensitivity-by-database-type) for details. +{{% /alert %}} + #### Examples ```sql @@ -1636,6 +1652,10 @@ ORDER BY LastName LIMIT 1 Removes leading and trailing characters from a `string`. If no `character` is specified for trimming, space is used. +{{% alert color="info" %}} +This function was introduced in Mendix version 11.11.0. +{{% /alert %}} + #### Syntax The syntax is as follows: @@ -1656,6 +1676,10 @@ TRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} +{{% alert color="info" %}} +Like with other String functions, case sensitivity of the `LOCATE` function depends on the database. See [Behavior of Case Sensitivity by Database Type](/refguide/case-sensitive-database-behavior/#behavior-of-case-sensitivity-by-database-type) for details. +{{% /alert %}} + #### Examples ```sql From c69e85379dc8f88fe5dc98fa1a4fa222e8aab018 Mon Sep 17 00:00:00 2001 From: MarkvanMents Date: Wed, 6 May 2026 16:48:29 +0200 Subject: [PATCH 4/6] Proofread --- .../refguide/modeling/domain-model/oql/_index.md | 3 +++ .../domain-model/oql/oql-expression-syntax.md | 12 ++++++------ 2 files changed, 9 insertions(+), 6 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 15b0cc0336c..a0cc36b4045 100644 --- a/content/en/docs/refguide/modeling/domain-model/oql/_index.md +++ b/content/en/docs/refguide/modeling/domain-model/oql/_index.md @@ -46,8 +46,11 @@ OQL is under constant development so some expressions and features are not avail | DATEPARSE | 11.10.0 | | DATETRUNC | 11.9.0 | | LOCATE | 11.9.0 | +| LTRIM | 11.11.0 | +| RTRIM | 11.11.0 | | STRING_AGG in View Entities and Datasets | 11.2.0 | | SUBSTRING | 11.9.0 | +| TRIM | 11.11.0 | ### [OQL Statements](/refguide/oql-statements/){#statement-versions} 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 40e56b8c52c..1345030575c 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 @@ -1334,7 +1334,7 @@ This query can no longer take advantage of an index for `LastName` for compariso ### LTRIM{#ltrim} -Removes leading characters from a `string`. If no `character` is specified for trimming, space is used. +Removes one or more leading characters from a `string`. If no character is specified for trimming, space is used. {{% alert color="info" %}} This function was introduced in Mendix version 11.11.0. @@ -1354,7 +1354,7 @@ LTRIM ( expression [, character ] ) ##### character -`character` is an optional single character string expression containing the character to trim. If omitted, the space character is used instead. +`character` is an optional single character string expression containing the character to remove from the start of the string. If omitted, the space character is used instead. {{% alert color="info" %}} Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. @@ -1555,7 +1555,7 @@ SELECT ROUND((Price : 7), 2) as RoundedPrice, Price : 7 FROM Sales.Order ### RTRIM{#rtrim} -Removes trailing characters from a `string`. If no `character` is specified for trimming, space is used. +Removes one or more trailing characters from a `string`. If no `character` is specified for trimming, space is used. {{% alert color="info" %}} This function was introduced in Mendix version 11.11.0. @@ -1575,7 +1575,7 @@ RTRIM ( expression [, character ] ) ##### character -`character` is an optional single character string expression containing the character to trim. If omitted, the space character is used instead. +`character` is an optional single character string expression containing the character to remove from the end of the string. If omitted, the space character is used instead. {{% alert color="info" %}} Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. @@ -1650,7 +1650,7 @@ ORDER BY LastName LIMIT 1 ### TRIM{#trim} -Removes leading and trailing characters from a `string`. If no `character` is specified for trimming, space is used. +Removes one or more leading and trailing characters from a `string`. If no `character` is specified for trimming, space is used. {{% alert color="info" %}} This function was introduced in Mendix version 11.11.0. @@ -1670,7 +1670,7 @@ TRIM ( expression [, character ] ) ##### character -`character` is an optional single character string expression containing the character to trim. If omitted, the space character is used instead. +`character` is an optional single character string expression containing the character which will be removed from the beginning and end of the string. If omitted, the space character is used. {{% alert color="info" %}} Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. From ec9dfa0b7da73b11f962ac7abc67bf3ee4b8e356 Mon Sep 17 00:00:00 2001 From: MarkvanMents Date: Thu, 7 May 2026 12:02:48 +0200 Subject: [PATCH 5/6] Add information about trimming everything and remove misleading case sensitivity information --- .../domain-model/oql/oql-expression-syntax.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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 1345030575c..166c9c5ed9c 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 @@ -1360,9 +1360,7 @@ LTRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} -{{% alert color="info" %}} -Like with other String functions, case sensitivity of the `LOCATE` function depends on the database. See [Behavior of Case Sensitivity by Database Type](/refguide/case-sensitive-database-behavior/#behavior-of-case-sensitivity-by-database-type) for details. -{{% /alert %}} +If the expression string consists entirely of the character, everything will be trimmed and the function will return a zero-length string. #### Examples @@ -1581,9 +1579,7 @@ RTRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} -{{% alert color="info" %}} -Like with other String functions, case sensitivity of the `LOCATE` function depends on the database. See [Behavior of Case Sensitivity by Database Type](/refguide/case-sensitive-database-behavior/#behavior-of-case-sensitivity-by-database-type) for details. -{{% /alert %}} +If the expression string consists entirely of the character, everything will be trimmed and the function will return a zero-length string. #### Examples @@ -1676,9 +1672,7 @@ TRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} -{{% alert color="info" %}} -Like with other String functions, case sensitivity of the `LOCATE` function depends on the database. See [Behavior of Case Sensitivity by Database Type](/refguide/case-sensitive-database-behavior/#behavior-of-case-sensitivity-by-database-type) for details. -{{% /alert %}} +If the expression string consists entirely of the character, everything will be trimmed and the function will return a zero-length string. #### Examples From a424f89393a7bc58489c0bcd2a586c80879e4173 Mon Sep 17 00:00:00 2001 From: MarkvanMents Date: Thu, 7 May 2026 14:40:08 +0200 Subject: [PATCH 6/6] Clarify that we are talking about the `character` in the command. --- .../modeling/domain-model/oql/oql-expression-syntax.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 166c9c5ed9c..44128164959 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 @@ -1360,7 +1360,7 @@ LTRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} -If the expression string consists entirely of the character, everything will be trimmed and the function will return a zero-length string. +If the expression string consists entirely of `character`, everything will be trimmed and the function will return a zero-length string. #### Examples @@ -1579,7 +1579,7 @@ RTRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} -If the expression string consists entirely of the character, everything will be trimmed and the function will return a zero-length string. +If the expression string consists entirely of `character`, everything will be trimmed and the function will return a zero-length string. #### Examples @@ -1672,7 +1672,7 @@ TRIM ( expression [, character ] ) Only a single character is supported. `character` parameters with more than one character may not work in all supported databases. {{% /alert %}} -If the expression string consists entirely of the character, everything will be trimmed and the function will return a zero-length string. +If the expression string consists entirely of `character`, everything will be trimmed and the function will return a zero-length string. #### Examples