Beruflich Dokumente
Kultur Dokumente
com +917411642061
Lab 9
Deleting Rows
Lab at a Glance................................................................2 Objectives..............................................................2 Summary................................................................2 Duration.................................................................2 Exercises..........................................................................3 Exercise 1: Create the Mapping.............................3 Exercise 2: Create and Run the Workflow..............6
9-1
Lab at a Glance
The exercises in this lab are designed to walk the student through the process of creating a session that only deletes rows from a table.
Objectives
After completing the lab, the student will be able to create and run a session that only deletes rows.
Summary
The purpose of this lab is to delete rows from an ODS table where customers do not have valid type codes, i.e., they have not been properly typed or have been marked INACTIVE. The completed mapping should look as follows:
Duration
This lab should take approximately 25 minutes.
9-2
Exercises
Exercise 1: Create the Mapping
Step 1. Copy a mapping. In your student folder, expand the Mappings subfolder. Highlight m_ODS_CUSTOMER_ACTIVE_xx. From the tool bar, select Edit-Copy.
You can also copy from one folder to another, by selecting a different folder before pasting.
When prompted to resolve a naming conflict, check Rename and click Edit.
9-3
Open the m_ODS_CUSTOMER_ACTIVE_del_xx mapping in the workspace. Save the repository. Step 2. Add a second filter transformation. Delete the links between lkp_CUSTOMER and ODS_CUSTOMER_ACTIVE. Add a Filter transformation to the mapping and name it fil_ODS_CUSTOMER_ACTIVE_delete. Copy/link the following ports from lkp_CUSTOMER to fil_ODS_CUSTOMER_ACTIVE_delete:
CUST_ID CUST_NAME FIRST_CONTACT CUSTOMER_STATE CUSTOMER_ZIP CUSTOMER_TYPE DISCOUNT_RATE
Edit fil_ODS_CUSTOMER ACTIVE_delete. On the Properties tab, add the following filter condition: ISNULL(CUSTOMER_TYPE) OR UPPER(RTRIM(CUSTOMER_TYPE))=INACTIVE Click OK to validate and save the filter condition. Click OK to close the Edit Transformation dialog box. Save the repository.
9-4
the fil_ODS_CUSTOMER_ACTIVE_delete to
ODS_CUSTOMER_ACTIVE.
9-5
On the Properties tab, set Treat source rows as to Delete. Select the Mapping tab. In the Navigation box, select the source SQ_INVOICE. Under Connections, click on the down arrow native_source and click OK. , select
In the Navigation box, select the target ODS_CUSTOMER_ACTIVE. Under Connections, click on the down arrow select native_target_xx and click OK. ,
in the Workflow
Monitor.
9-6
If more than 3 rows (shown above as Affected Rows) were deleted, fix the logic in the mapping or session. Before rerunning this workflow, the workflow from the previous exercise must be executed. In summary: Fix logic in the m_ODS_CUSTOMER_ACTIVE_del_xx mapping as required. Rerun wf_ODS_CUSTOMER_ACTIVE_xx workflow to repopulate the original 28 rows. Rerun wf_ODS_CUSTOMER_ACTIVE_del_xx workflow.
9-7