# Delete

The **Delete** step permanently removes a row from a database so you can cleanse your data. In the **Delete** step, choose a field to compare against the values of incoming fields from another step. When the comparison requirements are satisfied, the database row is deleted. If multiple rows match, all rows with that value are deleted from the database.

### General

The following table describes the general options for the **Delete** step.

| Option            | Description                                                                                                                                                                                                                                                                                                                                            |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Step name**     | Specifies the unique name of the **Delete** step on the canvas. You can customize the name or leave it as the default.                                                                                                                                                                                                                                 |
| **Connection**    | <p>Select the name of a connected database from the drop-down list. Alternatively, you can:</p><ul><li>Select <strong>Edit</strong> to update an existing database connection.</li><li>Select <strong>New</strong> to create a database connection.</li><li>Select <strong>Wizard</strong> to create a database connection using the wizard.</li></ul> |
| **Target schema** | Specify the schema of the table in the database.                                                                                                                                                                                                                                                                                                       |
| **Target table**  | Specify the name of the table in your database where you want to delete the data.                                                                                                                                                                                                                                                                      |
| **Commit size**   | <p>Specify the commit batch size. This is the number of <code>DELETE</code> statements to perform before sending a <code>COMMIT</code> command to the database.</p><p>If blank or set to <code>0</code>, the database determines the commit size. The default is 100.</p>                                                                              |

### Keys

The columns in the following table define the key(s) used to map the row(s) to delete.

| Column             | Description                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Table field**    | Specify the target table field you want to compare against. The list is populated from the **Target table** columns.                                                                                                                                                                                                                                                                                                                     |
| **Comparator**     | <p>Specify the comparator to use. Depending on your database and target table settings, comparisons might be case-sensitive.</p><p>Available comparators:</p><ul><li><code>=</code></li><li><code><></code></li><li><code><</code></li><li><code><=</code></li><li><code>></code></li><li><code>>=</code></li><li><code>LIKE</code></li><li><code>BETWEEN</code></li><li><code>IS NULL</code></li><li><code>IS NOT NULL</code></li></ul> |
| **Stream field 1** | Specify the incoming stream field that contains the value to compare against the **Table field**.                                                                                                                                                                                                                                                                                                                                        |
| **Stream field 2** | Specify the incoming stream field to use as the second value for the `BETWEEN` comparison.                                                                                                                                                                                                                                                                                                                                               |
| **Get fields**     | Select to populate **Stream field 1** and **Stream field 2** from previous steps in your transformation.                                                                                                                                                                                                                                                                                                                                 |

For example, if the lookup value of `QUANTITYORDERED` is less than or equal to `min_quantityordered`, and the `PRODUCTLINE` values match, that `QUANTITYORDERED` row is deleted from the `STG_SALES_DATA` table.

### Metadata injection support

This step supports metadata injection. You can use it with [ETL metadata injection](https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/etl-metadata-injection) to pass metadata to your transformation at runtime.
