Delete DB

Sometimes you might have to delete data from a table. If the operation to do it is simple, for example:

DELETE FROM ORDERS_TABLE WHERE STATUS='Shipped'

Or

DELETE FROM TMP_TABLE

You could simply execute it by using an SQL job entry or an Execute SQL script step. If you face the second of the above situations, you can even use a Truncate table job entry.

For more complex scenarios, you should use the Delete step.

Steel Wheels are launching a campaign, focusing on Customers who have ordered more than 50 of each of their various Productlines.

To create a new transformation

  1. In Spoon, click File > New > Transformation.

Any one of these actions opens a new Transformation tab for you to begin designing your transformation.

  • By clicking New, then Transformation

  • By using the CTRL-N hot key

Before we kick off .. lets take a look at the stg_sales_data table data to get an understanding of what results to expect..

  1. View the STG_SALES_DATA data.

As you can see we have a QUANTITYORDERED for each of our PRODUCTLINES. Each ORDERNUMBER is associated with Customer details.

  1. Execute the following statement.

select * from STG_SALES_DATA
where QUANTITYORDERED > '50';

The results indicate that ORDERNUMBER 10339 where the QUANTITYORDERED is 55 should be the first expected record.

Last updated