Document new OQL feature: INSERT ... VALUES#11543
Open
passalaqua wants to merge 1 commit into
Open
Conversation
dahfjkg
reviewed
Jul 15, 2026
d97ed1f to
3fe4001
Compare
Contributor
|
Passed team review |
MarkvanMents
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR @passalaqua
I've expanded the introduction to explain what each option does, rather than just leap into the syntax.
I've also tried to expand the syntax description to try to make it clear what you can use. I found the explanation of a "valid expression" was a bit unclear in the terminology so I've tried to clarify.
Hope I haven't made things worse!
Comment on lines
+160
to
+165
| Available from Mendix version 11.6.0 when sourcing data from an oql query. | ||
| Available from Mendix version 11.13.0 when using `VALUES` to specify rows directly. | ||
| {{% /alert %}} | ||
|
|
||
| The syntax of `INSERT` statements is: | ||
| `INSERT` statements can be written with values or queries. | ||
|
|
Collaborator
There was a problem hiding this comment.
I think we should add a bit more information here:
Suggested change
| Available from Mendix version 11.6.0 when sourcing data from an oql query. | |
| Available from Mendix version 11.13.0 when using `VALUES` to specify rows directly. | |
| {{% /alert %}} | |
| The syntax of `INSERT` statements is: | |
| `INSERT` statements can be written with values or queries. | |
| You can use the `INSERT` statement to insert new entity objects into your data. You can do this in two ways: | |
| * using an OQL query – extracting data and use it to insert one or more new objects | |
| * using values – specifying explicit values and use these to insert one or more new objects | |
| {{% alert color="info" %}} | |
| Available from Mendix version 11.6.0. | |
| You can use an OQL query from Mendix version 11.6.0. | |
| You can use values from Mendix version 11.13.0. | |
| {{% /alert %}} |
| The syntax of `INSERT` statements is: | ||
| `INSERT` statements can be written with values or queries. | ||
|
|
||
| ### `INSERT` with query |
Collaborator
There was a problem hiding this comment.
Suggested change
| ### `INSERT` with query | |
| ### `INSERT` with OQL Query | |
| Insert with OQL query allows you to extract data using an OQL query and insert those values as one or more entity objects. |
| SELECT NewOrderNumber, Loader.TemporaryData_Customer/Loader.Customer/Number, Loader.TemporaryData_Customer FROM Loader.TemporaryData | ||
| ``` | ||
|
|
||
| ### `INSERT` with `VALUES` |
Collaborator
There was a problem hiding this comment.
Suggested change
| ### `INSERT` with `VALUES` | |
| ### `INSERT` with Values | |
| Insert with values allows you to insert a list of literals or OQL parameters as one or more entity objects. |
Comment on lines
+198
to
+200
| * `expression n` is any valid OQL expression with literals or OQL parameters. | ||
| Every row must contain the same number of values of compatible types. | ||
| This query can *not* select data from any entities. |
Collaborator
There was a problem hiding this comment.
Suggested change
| * `expression n` is any valid OQL expression with literals or OQL parameters. | |
| Every row must contain the same number of values of compatible types. | |
| This query can *not* select data from any entities. | |
| * `expression x` is any valid expression consisting solely of literals or OQL expressions. Every row must contain the same number of values of compatible types as the list of attributes you are inserting for each entity object. | |
| {{% alert color="info" %}}This expression cannot use OQL clauses to select data from any entities.{{% /alert %}} |
|
|
||
| * `entity` is the entity for which new objects will be created. | ||
|
|
||
| * `attribute` is an attribute of the entity that will be inserted. |
Collaborator
There was a problem hiding this comment.
Suggested change
| * `attribute` is an attribute of the entity that will be inserted. | |
| * `attribute` is an attribute of the entity that will be inserted. | |
| {{% alert color="info" %}}You cannot insert associations when inserting with values.{{% /alert %}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To be released with 11.13.