Table of Contents

Search

  1. Preface
  2. Introduction to Transformations
  3. Transformation Ports
  4. Transformation Caches
  5. Address Validator Transformation
  6. Aggregator Transformation
  7. Association Transformation
  8. Bad Record Exception Transformation
  9. Case Converter Transformation
  10. Classifier Transformation
  11. Comparison Transformation
  12. Consolidation Transformation
  13. Data Masking Transformation
  14. Data Processor Transformation
  15. Decision Transformation
  16. Duplicate Record Exception Transformation
  17. Expression Transformation
  18. Filter Transformation
  19. Hierarchical to Relational Transformation
  20. Java Transformation
  21. Java Transformation API Reference
  22. Java Expressions
  23. Joiner Transformation
  24. Key Generator Transformation
  25. Labeler Transformation
  26. Lookup Transformation
  27. Lookup Caches
  28. Dynamic Lookup Cache
  29. Match Transformation
  30. Match Transformations in Field Analysis
  31. Match Transformations in Identity Analysis
  32. Normalizer Transformation
  33. Merge Transformation
  34. Parser Transformation
  35. Python Transformation
  36. Rank Transformation
  37. Read Transformation
  38. Relational to Hierarchical Transformation
  39. REST Web Service Consumer Transformation
  40. Router Transformation
  41. Sequence Generator Transformation
  42. Sorter Transformation
  43. SQL Transformation
  44. Standardizer Transformation
  45. Union Transformation
  46. Update Strategy Transformation
  47. Web Service Consumer Transformation
  48. Parsing Web Service SOAP Messages
  49. Generating Web Service SOAP Messages
  50. Weighted Average Transformation
  51. Window Transformation
  52. Write Transformation
  53. Appendix A: Transformation Delimiters

Developer Transformation Guide

Developer Transformation Guide

Lookup Transformation Values Example

Lookup Transformation Values Example

For example, you create a mapping with the following objects:
The mapping contains a source, Lookup transformation, contains a Router transformation, and then splits into two branches. Each branch contains an Update Strategy transformation and the same target. One branch updates the target. The other branch inserts new records in the target.
For the Lookup transformation, you enable dynamic lookup caching and define the following lookup condition:
IN_CUST_ID = CUST_ID
By default, the row type of all rows entering the Lookup transformation is insert. To perform both inserts and updates in the cache and target table, you select the
Insert Else Update
property in the Lookup transformation.

Initial Cache Values

When you run the mapping, the Integration Service builds the lookup cache from the target table.
The following table shows the initial values of the lookup cache:
PK_PRIMARYKEY
CUST_ID
CUST_NAME
ADDRESS
100001
80001
Marion James
100 Main St.
100002
80002
Laura Jones
510 Broadway Ave.
100003
80003
Shelley Lau
220 Burnside Ave.

Input Values

The source contains rows that exist and rows that do not exist in the target table. The Integration Service passes the source rows into the Lookup transformation.
The following table shows the source rows:
SQ_CUST_ID
SQ_CUST_NAME
SQ_ADDRESS
80001
Marion Atkins
100 Main St.
80002
Laura Gomez
510 Broadway Ave.
99001
Jon Freeman
555 6th Ave.

Lookup Values

The Integration Service looks up values in the cache based on the lookup condition. It updates rows in the cache for existing customer IDs 80001 and 80002. It inserts a row into the cache for customer ID 99001. The Integration Service generates a new key (PK_PRIMARYKEY) for the new row.
The following table shows the rows and values returned from the lookup:
PK_PRIMARYKEY
CUST_ID
CUST_NAME
ADDRESS
100001
80001
Marion Atkins
100 Main St.
100002
80002
Laura Gomez
510 Broadway Ave.
100004
99001
Jon Freeman
555 6th Ave.

Output Values

The Integration Service flags the rows in the Lookup transformation based on the inserts and updates it performs on the dynamic cache. The Integration Service eventually pass the rows to a Router transformation that creates a branch for insert rows and another branch for update rows. Each branch contains an Update Strategy transformation. The Update Strategy transformations flag the rows for insert or update based on the value of the NewLookupRow port.
The output values of the lookup/output and input/output ports depend on whether you choose to output old or new values when the Integration Service updates a row. However, the output values of the NewLookupRow port and any lookup/output port that uses the sequence ID is the same for new and updated rows.
If you choose to output new values, the lookup/output ports output the following values:
NewLookupRow
PK_PRIMARYKEY
CUST_ID
CUST_NAME
ADDRESS
2
100001
80001
Marion Atkins
100 Main St.
2
100002
80002
Laura Gomez
510 Broadway Ave.
1
100004
99001
Jon Freeman
555 6th Ave.
If you choose to output old values, the lookup/output ports output the following values:
NewLookupRow
PK_PRIMARYKEY
CUST_ID
CUST_NAME
ADDRESS
2
100001
80001
Marion James
100 Main St.
2
100002
80002
Laura Jones
510 Broadway Ave.
1
100004
99001
Jon Freeman
555 6th Ave.
When the Integration Service updates rows in the lookup cache it uses the primary key (PK_PRIMARYKEY) values for rows in the cache and the target table.
The Integration Service uses the sequence ID to generate a primary key for the customer that it does not find in the cache. The Integration Service inserts the primary key value into the lookup cache and it returns the value to the lookup/output port.
The Integration Service outputs the values from the input/output ports that match the input values.
If the input value is NULL and you select the Ignore Null property for the associated input port, the input value does not equal the lookup value or the value out of the input/output port. When you select the Ignore Null property, the lookup cache and the target table might become unsynchronized if you pass null values to the target. You must verify that you do not pass null values to the target.

0 COMMENTS

We’d like to hear from you!