MySQL Shell API 8.0.40
Unified development interface for MySQL Products
|
Operation to delete data from a table. More...
Methods | |
TableDelete | delete () |
Initializes the deletion operation. More... | |
TableDelete | where (str expression) |
Sets the search condition to filter the records to be deleted from the Table. More... | |
TableDelete | order_by (list sortCriteria) |
Sets the order in which the records will be deleted. More... | |
TableDelete | limit (int numberOfRows) |
Sets the maximum number of rows to be deleted by the operation. More... | |
TableDelete | bind (str 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 the deletion operation.
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 | ( | str | expression | ) |
Sets the search condition to filter the records to be deleted from the Table.
expression | A 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 order_by | ( | list | sortCriteria | ) |
Sets the order in which the records will be deleted.
If used, the TableDelete operation will delete the records in the order established by the sort criteria.
Every defined sort criterion follows the format:
name [ ASC | DESC ]
ASC is used by default if the sort order is not specified.
This function can be invoked only once after:
TableDelete limit | ( | int | 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:
After this function invocation, the following functions can be invoked:
TableDelete bind | ( | str | 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 the given value to the placeholder with the specified name.
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:
Result execute | ( | ) |
Executes the delete operation with all the configured options.
This function can be invoked after any other function on this class.