P. 1
Informatica PowerCenter 9.0 Transformation Guide

Informatica PowerCenter 9.0 Transformation Guide

|Views: 11,808|Likes:
Published by Dipankar

More info:

Published by: Dipankar on Sep 24, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/03/2014

pdf

text

original

When you enter join syntax, use the Informatica or database-specific join syntax. When you use the Informatica
join syntax, the Integration Service translates the syntax and passes it to the source database during the session.

Note: Always use database-specific syntax for join conditions.

When you use Informatica join syntax, enclose the entire join statement in braces ({Informatica syntax}). When
you use database syntax, enter syntax supported by the source database without braces.

When using Informatica join syntax, use table names to prefix column names. For example, if you have a column
named FIRST_NAME in the REG_CUSTOMER table, enter “REG_CUSTOMER.FIRST_NAME” in the join syntax.
Also, when using an alias for a table name, use the alias within the Informatica join syntax to ensure the
Integration Service recognizes the alias.

The following table lists the join syntax you can enter, in different locations for different Source Qualifier
transformations, when you create an outer join:

Transformation

Transformation Setting

Description

Source Qualifier
Transformation

User-Defined Join

Create a join override. The Integration Service appends the
join override to the WHERE or FROM clause of the default
query.

SQL Query

Enter join syntax immediately after the WHERE in the default
query.

Application Source
Qualifier Transformation

Join Override

Create a join override. The Integration Service appends the
join override to the WHERE clause of the default query.

Extract Override

Enter join syntax immediately after the WHERE in the default
query.

You can combine left outer and right outer joins with normal joins in a single source qualifier. Use multiple normal
joins and multiple left outer joins.

When you combine joins, enter them in the following order:

1.Normal
2.Left outer
3.Right outer

Note: Some databases limit you to using one right outer join.

Normal Join Syntax

You can create a normal join using the join condition in a source qualifier. However, if you are creating an outer
join, you need to override the default join to perform an outer join. As a result, you need to include the normal join

332 Chapter 24: Source Qualifier Transformation

in the join override. When incorporating a normal join in the join override, list the normal join before outer joins.
You can enter multiple normal joins in the join override.

To create a normal join, use the following syntax:

{ source1 INNER JOIN source2 on join_condition }

The following table displays the syntax for Normal Joins in a Join Override:

Syntax

Description

source1

Source table name. The Integration Service returns rows from this table that match the join condition.

source2

Source table name. The Integration Service returns rows from this table that match the join condition.

join_condition

Condition for the join. Use syntax supported by the source database. You can combine multiple join
conditions with the AND operator.

For example, you have a REG_CUSTOMER table with data for registered customers:

CUST_ID

FIRST_NAME

LAST_NAME

00001

Marvin

Chi

00002

Dinah

Jones

00003

John

Bowden

00004

J.

Marks

The PURCHASES table, refreshed monthly, contains the following data:

TRANSACTION_NO

CUST_ID

DATE

AMOUNT

06-2000-0001

00002

6/3/2000

55.79

06-2000-0002

00002

6/10/2000

104.45

06-2000-0003

00001

6/10/2000

255.56

06-2000-0004

00004

6/15/2000

534.95

06-2000-0005

00002

6/21/2000

98.65

06-2000-0006

NULL

6/23/2000

155.65

06-2000-0007

NULL

6/24/2000

325.45

To return rows displaying customer names for each transaction in the month of June, use the following syntax:

{ REG_CUSTOMER INNER JOIN PURCHASES on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID }

The Integration Service returns the following data:

CUST_ID

DATE

AMOUNT

FIRST_NAME

LAST_NAME

00002

6/3/2000

55.79

Dinah

Jones

00002

6/10/2000

104.45

Dinah

Jones

00001

6/10/2000

255.56

Marvin

Chi

00004

6/15/2000

534.95

J.

Marks

00002

6/21/2000

98.65

Dinah

Jones

The Integration Service returns rows with matching customer IDs. It does not include customers who made no
purchases in June. It also does not include purchases made by non-registered customers.

Left Outer Join Syntax

You can create a left outer join with a join override. You can enter multiple left outer joins in a single join override.
When using left outer joins with other joins, list all left outer joins together, after any normal joins in the statement.

To create a left outer join, use the following syntax:

{ source1 LEFT OUTER JOIN source2 on join_condition }

Outer Join Support 333

The following tables displays syntax for left outer joins in a join override:

Syntax

Description

source1

Source table name. With a left outer join, the Integration Service returns all rows in this table.

source2

Source table name. The Integration Service returns rows from this table that match the join
condition.

join_condition

Condition for the join. Use syntax supported by the source database. You can combine
multiple join conditions with the AND operator.

For example, using the same REG_CUSTOMER and PURCHASES tables described in “Normal Join Syntax” on
page 332, you can determine how many customers bought something in June with the following join override:

{ REG_CUSTOMER LEFT OUTER JOIN PURCHASES on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID }

The Integration Service returns the following data:

CUST_ID

FIRST_NAME

LAST_NAME

DATE

AMOUNT

00001

Marvin

Chi

6/10/2000

255.56

00002

Dinah

Jones

6/3/2000

55.79

00003

John

Bowden

NULL

NULL

00004

J.

Marks

6/15/2000

534.95

00002

Dinah

Jones

6/10/2000

104.45

00002

Dinah

Jones

6/21/2000

98.65

The Integration Service returns all registered customers in the REG_CUSTOMERS table, using null values for the
customer who made no purchases in June. It does not include purchases made by non-registered customers.

Use multiple join conditions to determine how many registered customers spent more than $100.00 in a single
purchase in June:

{REG_CUSTOMER LEFT OUTER JOIN PURCHASES on (REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID AND
PURCHASES.AMOUNT > 100.00) }

The Integration Service returns the following data:

CUST_ID

FIRST_NAME

LAST_NAME

DATE

AMOUNT

00001

Marvin

Chi

6/10/2000

255.56

00002

Dinah

Jones

6/10/2000

104.45

00003

John

Bowden

NULL

NULL

00004

J.

Marks

6/15/2000

534.95

You might use multiple left outer joins if you want to incorporate information about returns during the same time
period. For example, the RETURNS table contains the following data:

CUST_ID

CUST_ID

RETURN

00002

6/10/2000

55.79

00002

6/21/2000

104.45

To determine how many customers made purchases and returns for the month of June, use two left outer joins:

{ REG_CUSTOMER LEFT OUTER JOIN PURCHASES on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID LEFT OUTER JOIN
RETURNS on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID }

The Integration Service returns the following data:

CUST_ID

FIRST_NAME

LAST_NAME

DATE

AMOUNT

RET_DATE

RETURN

00001

Marvin

Chi

6/10/2000

255.56

NULL

NULL

00002

Dinah

Jones

6/3/2000

55.79

NULL

NULL

00003

John

Bowden

NULL

NULL

NULL

NULL

00004

J.

Marks

6/15/2000

534.95

NULL

NULL

00002

Dinah

Jones

6/10/2000

104.45

NULL

NULL

00002

Dinah

Jones

6/21/2000

98.65

NULL

NULL

00002

Dinah

Jones

NULL

NULL

6/10/2000

55.79

00002

Dinah

Jones

NULL

NULL

6/21/2000

104.45

The Integration Service uses NULLs for missing values.

334 Chapter 24: Source Qualifier Transformation

Right Outer Join Syntax

You can create a right outer join with a join override. The right outer join returns the same results as a left outer
join if you reverse the order of the tables in the join syntax. Use only one right outer join in a join override. If you
want to create more than one right outer join, try reversing the order of the source tables and changing the join
types to left outer joins.

When you use a right outer join with other joins, enter the right outer join at the end of the join override.

To create a right outer join, use the following syntax:

{ source1 RIGHT OUTER JOIN source2 on join_condition }

The following table displays syntax for a right outer join in a join override:

Syntax

Description

source1

Source table name. The Integration Service returns rows from this table that match the join condition.

source2

Source table name. With a right outer join, the Integration Service returns all rows in this table.

join_condition

Condition for the join. Use syntax supported by the source database. You can combine multiple join
conditions with the AND operator.

You might use a right outer join with a left outer join to join and return all data from both tables, simulating a full
outer join. For example, you can extract all registered customers and all purchases for the month of June with the
following join override:

{REG_CUSTOMER LEFT OUTER JOIN PURCHASES on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID RIGHT OUTER JOIN
PURCHASES on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID }

The Integration Service returns the following data:

CUST_ID

FIRST_NAME

LAST_NAME

TRANSACTION_NO

DATE

AMOUNT

00001

Marvin

Chi

06-2000-0003

6/10/2000

255.56

00002

Dinah

Jones

06-2000-0001

6/3/2000

55.79

00003

John

Bowden

NULL

NULL

NULL

00004

J.

Marks

06-2000-0004

6/15/2000

534.95

00002

Dinah

Jones

06-2000-0002

6/10/2000

104.45

00002

Dinah

Jones

06-2000-0005

6/21/2000

98.65

NULL

NULL

NULL

06-2000-0006

6/23/2000

155.65

NULL

NULL

NULL

06-2000-0007

6/24/2000

325.45

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->