MySQL Shell API
8.0.18
Unified development interface for MySQL Products
|
Operation to delete data from a table. More...
Methods | |
TableDelete | delete () |
Initializes this record deletion handler. More... | |
TableDelete | where (String expression) |
Sets the search condition to filter the records to be deleted from the Table. More... | |
TableDelete | orderBy (List sortExprStr) |
Sets the order in which the records will be deleted. More... | |
TableDelete | limit (Integer numberOfRows) |
Sets the maximum number of rows to be deleted by the operation. More... | |
TableDelete | bind (String name, Value value) |
Binds a value to a specific placeholder used on this operation. More... | |
Result | execute () |
Executes the delete operation with all the configured options. More... | |
Operation to delete data from a table.
Handler for Delete operation on Tables.
TableDelete delete | ( | ) |
Initializes this record deletion handler.
This function is called automatically when Table.delete() is called.
The actual deletion of the records will occur only when the execute method is called.
After this function invocation, the following functions can be invoked:
TableDelete where | ( | String | expression | ) |
Sets the search condition to filter the records to be deleted from the Table.
expression | Optional condition to filter the records to be deleted. |
If used, only those rows satisfying the expression will be deleted
The expression supports parameter binding.
This function can be invoked only once after:
After this function invocation, the following functions can be invoked:
TableDelete orderBy | ( | List | sortExprStr | ) |
Sets the order in which the records will be deleted.
If used the records will be deleted in the order established by the sort criteria.
The elements of sortExprStr list are strings defining the column name on which the sorting will be based.
The format is as follows: columnIdentifier [ ASC | DESC ]
If no order criteria is specified, ASC will be used by default.
This function can be invoked only once after:
After this function invocation, the following functions can be invoked:
TableDelete limit | ( | Integer | numberOfRows | ) |
Sets the maximum number of rows to be deleted by the operation.
numberOfRows | The maximum number of rows to be deleted. |
If used, the operation will delete only numberOfRows rows.
This function can be invoked only once after:
This function can be called every time the statement is executed.
After this function invocation, the following functions can be invoked:
TableDelete bind | ( | String | name, |
Value | value | ||
) |
Binds a value to a specific placeholder used on this operation.
name | The name of the placeholder to which the value will be bound. |
value | The value to be bound on the placeholder. |
Binds a value to a specific placeholder used on this operation.
An error will be raised if the placeholder indicated by name does not exist.
This function must be called once for each used placeholder or an error will be raised when the execute method is called.
This function can be invoked multiple times right before calling execute:
After this function invocation, the following functions can be invoked:
An error will be raised if the placeholder indicated by name does not exist.
This function must be called once for each used placeholder or an error will be raised when the execute method is called.
Result execute | ( | ) |
Executes the delete operation with all the configured options.
This function can be invoked after any other function on this class.