Sie sind auf Seite 1von 7

BANGALORE TECHNICAL TRAININGS Onlinetrainingsbglr@gmail.

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

PowerCenter 9.x Level I Developer Lab Guide

9-1

Lab 9. Deleting Rows

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

PowerCenter 9.x Level I Developer Lab Guide

Lab 9. Deleting Rows

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.

Select Edit-Paste. When prompted to copy, click Yes.

When prompted to resolve a naming conflict, check Rename and click Edit.

Rename the copy m_ODS_CUSTOMER_ACTIVE_del_xx and click OK.

PowerCenter 9.x Level I Developer Lab Guide

9-3

Lab 9. Deleting Rows

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

PowerCenter 9.x Level I Developer Lab Guide

Lab 9. Deleting Rows

Step 3. Link the target definition.


Autolink by name

the fil_ODS_CUSTOMER_ACTIVE_delete to

ODS_CUSTOMER_ACTIVE.

Save the repository.

PowerCenter 9.x Level I Developer Lab Guide

9-5

Lab 9. Deleting Rows

Exercise 2: Create and Run the Workflow


Step 1. Create a workflow. Create a workflow called wf_ODS_CUSTOMER_ACTIVE_del_xx. Create a session task called s_m_ODS_CUSTOMER_ACTIVE_del_xx. Double-click on the session task. The Edit Tasks dialog box appears.

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. ,

Under Properties, the Target load type should be defaulted to Normal.

Click OK to close the Edit Tasks dialog box.

Link Start to s_m_ODS_CUSTOMER_ACTIVE_del_xx:

Save, validate and start


wf_ODS_CUSTOMER_ACTIVE_del_xx.

Monitor and review the results for


s_m_ODS_CUSTOMER_ACTIVE_del_xx

in the Workflow

Monitor.

9-6

PowerCenter 9.x Level I Developer Lab Guide

Lab 9. Deleting Rows

Step 2. Verify results session properties.

Step 3. Verify results session transformation statistics.

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.

PowerCenter 9.x Level I Developer Lab Guide

9-7

Das könnte Ihnen auch gefallen