You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`entity` is the entity whose objects are being updated.
83
+
*`entity` is the entity whose objects are being updated.
84
+
85
+
*`attribute` is an attribute of the entity that is being updated.
86
+
87
+
An attribute of type `autonumber` can not be updated. The `ID` attribute of an entity cannot be updated.
88
+
89
+
*`association` is an association that is being updated. Associations can be updated in Mendix version 11.4.0 and above.
90
+
91
+
Multiple attributes and associations can be updated in the same statement.
73
92
74
-
`attribute` is an attribute of the entity that is being updated. `association` is an association that is being updated. Multiple attributes and associations can be updated in the same statement. An attribute of type `autonumber` can not be updated. The `ID` field of an entity cannot be updated.
93
+
*`expression` is a new value of an attribute or association. Any [OQL expression](/refguide/oql-expressions/) is allowed.
75
94
76
-
`expression` is a new value of an attribute or association. Any [OQL expression](/refguide/oql-expressions/) is allowed. When updating attributes, the value type of the expression should match the attribute type according to [type coercion precedence](/refguide/oql-expression-syntax/#type-coercion). When updating an enumeration attribute using a literal, the literal must be a valid value for the enumeration. When updating an enumeration attribute using another enumeration, the expression enumeration must be a subset of the attribute enumeration. When updating a string attribute using a string literal, the literal length must be equal to or less than the length of the attribute. In the case of associations, association and entity expressions must match the target association type. Values of type LONG can also be used as association values, but they must be valid ids of associations which are of the target association type.
95
+
* When updating attributes, the value type of the expression should match the attribute type according to [type coercion precedence](/refguide/oql-expression-syntax/#type-coercion).
96
+
* When updating an enumeration attribute using a literal, the literal must be a valid value for the enumeration.
97
+
* When updating an enumeration attribute using another enumeration, the expression enumeration must be a subset of the attribute enumeration.
98
+
* When updating a string attribute using a string literal, the literal length must be equal to or less than the length of the attribute.
99
+
* In the case of associations, association and entity expressions must match the target association type.
100
+
101
+
Values of type LONG can also be used as association values, but they must be valid ids of associations which are of the target association type.
77
102
78
-
`condition` can be anything that can appear in an OQL [WHERE clause](/refguide/oql-clauses/#where).
103
+
*`condition` can be anything that can appear in an OQL [WHERE clause](/refguide/oql-clauses/#where).
* It is not yet possible to insert associations. As a workaround, they can be added after the `INSERT` using an OQL `UPDATE` statement.
196
+
* Attributes of type "Date and time" with a default value of `'[%CurrentDateTime%]'` will not have their default values set when the `INSERT` statement does not specify them.
197
+
As a workaround, explicitly insert the attribute with a value of `'[%CurrentDatetime%]'` in the `SELECT` part.
198
+
* When using Oracle, due to database limitations, inserting attributes of type unlimited string or binary is not supported.
199
+
* The general limitations for OQL statements also apply. See [General Limitations for OQL Statements](#oql-limitations), below.
200
+
201
+
## General Limitations for OQL Statements {#oql-limitations}
202
+
203
+
* OQL statements can be used only with persistable entities.
204
+
* Entity access rules are not applied to any OQL statements.
205
+
* No event handlers will be executed.
206
+
* Runtime and client state will not be updated with the changes.
207
+
208
+
### Joins
143
209
144
210
You cannot directly join other entities in the `FROM` clause of OQL `DELETE` or in the `UPDATE` clause of OQL `UPDATE`. However, you can achieve the same result using long paths or subqueries. For example:
145
211
@@ -160,9 +226,4 @@ WHERE ID IN (
160
226
WHEREModule.Customer/Name ='Mary' )
161
227
```
162
228
163
-
## General Limitations for OQL Statements {#oql-limitations}
164
229
165
-
* OQL statements can be used only with persistable entities.
166
-
* Entity access rules are not applied to any OQL statements.
167
-
* No event handlers will be executed.
168
-
* Runtime and client state will not be updated with the changes.
0 commit comments