where
Adds a WHERE clause to the UPDATE statement.
This function specifies the conditions that must be met for a row to be updated. The clause lambda provides a Clause receiver to build the conditional expression.
Multiple calls to where will overwrite the previous WHERE clause.
CAUTION: If where is not called, the UPDATE statement will apply to all rows in the table.
Example
// Updates the status of all pending orders to 'shipped'.
Orders
.update {
it.status.bind("shipped")
}.where {
it.status EQ "pending"
}.execute()Content copied to clipboard
Return
The UpdateStatement instance for further chaining of operations like orderBy, limit, or execution.
Author
MOHAMMAD AZIM ANSARI
Parameters
clause
A lambda function with a Clause receiver to construct the conditional logic.