MySqlDelete
Execute a MySQL DELETE statement.
Added in version 1.0.0.
Friendly name:
MySQL DeleteStep class:
base_steps_syncpack.steps.MySqlDelete.MySqlDeleteStep version:
1.0.0Required parameters:
database,host,port,username,password
Parameters
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
no |
– |
The database table name. Example: |
|
string |
yes |
– |
The database name. Example: |
|
string |
yes |
– |
The host of the database. Example: |
|
number |
yes |
|
The port of the database. Example: |
|
string |
yes |
– |
The database username. Example: |
|
string |
yes |
– |
The database password. Example: |
|
string (long) |
no |
– |
A full DELETE statement. Overrides the ‘data’ parameter. Example: |
|
string (long) |
no |
– |
where condition Example: |
Every step also accepts the platform parameters common to all steps – see Platform parameters.
Dependencies
Inherits from:
MySqlDelete->BaseStep->SerializableSyncPack modules:
base_steps_syncpack.util.mysql_utilsExternal packages:
ipaascommon,ipaascore
Behaviour
Runs a DELETE and commits, via util.mysql_utils (get_connection /
execute_query). Unlike the other MySQL steps, its connection parameters are
imported StepParameter singletons from mysql_utils rather than declared
inline — the effect is the same, but a change there changes this step.
The statement is resolved as:
delete_query, used verbatim, and must start withdelete;otherwise
DELETE FROM {database}.{table}, withWHERE {where}appended whenwhereis set;otherwise
MissingRequiredStepParameteris raised.
Outputs
None. The step does not call save_data_for_next_step.
Notes
Warning
where defaults to an empty string, and an empty where builds
DELETE FROM db.table with no predicate — which deletes every row in the
table. There is no confirmation and no dry run. Always set where, or put
the full predicate in delete_query.
portdefaults to7706, the SL1 MySQL port.delete_queryoverrides the built statement, sotable/whereare ignored when it is set.