Delete DB table
Delete rows from STG_SALES_DATA using transformation-driven criteria.
Workshop - Delete DB table
Delete rows from STG_SALES_DATA based on criteria in a stream.
This workshop uses a product line list and a minimum quantity threshold.
Use this step when your delete logic is driven by transformation output. Use Execute SQL script for simple deletes.
What you’ll do
Inspect the target table before you delete
Build a delete criteria stream (product line + quantity)
Delete matching rows with Delete
Validate results with SQL
Prerequisites
STG_SALES_DATAexists. Create it in Create DB table.A working database connection. See Database Connections.
Estimated time: 20 minutes
Back up your table before you run deletes. You can copy the table, or use a database snapshot.

Start Spoon.
Drag the CSV File Input step onto the canvas.
Open the CSV File Input properties dialog box.
Configure it to read:
${Internal.Transformation.Filename.Directory}/productlines.csvSelect Get Fields.

Delete
Delete is a terminal step. It does not pass rows downstream.
It builds DELETE statements from the input stream.
Be careful with the comparators in this step. Always validate your criteria before you run.
Drag the Delete step onto the canvas.
Open the Delete properties dialog box.
Configure the database Connection and set Table name to
STG_SALES_DATA.Map stream fields to table fields for your delete criteria.

Last updated
Was this helpful?





