This action might not be possible to undo. Are you sure you want to continue?
Passive Transformation Can be Connected or Unconnected. Dynamic lookup is connected. Use a Lookup transformation in a mapping to look up data in a flat file or a relational table, view, or synonym. We can import a lookup definition from any flat file or relational database to which both the PowerCenter Client and Server can connect. We can use multiple Lookup transformations in a mapping. The Power Center Server queries the lookup source based on the lookup ports in t he transformation. It compares Lookup transformation port values to lookup sourc e column values based on the lookup condition. Pass the result of the lookup to other transformations and a target. We can use the Lookup transformation to perform following: Get a related value: EMP has DEPTNO but DNAME is not there. We use Lookup to get DNAME from DEPT table based on Lookup Condition. Perform a calculation: We want only those Employees who s SAL > Average (SAL). We will write Lookup Override query. Update slowly changing dimension tables: Most important use. We can use a Lo okup transformation to determine whether rows already exist in the target. 1. LOOKUP TYPES We can configure the Lookup transformation to perform the following types of loo kups: Connected or Unconnected Relational or Flat File Cached or Un cached Relational Lookup: When we create a Lookup transformation using a relational table as a lookup sour ce, we can connect to the lookup source using ODBC and import the table definiti on as the structure for the Lookup transformation. We can override the default SQL statement if we want to add a WHERE clause o r query multiple tables. We can use a dynamic lookup cache with relational lookups. Flat File Lookup: When we use a flat file for a lookup source, we can use any flat file definition in the repository, or we can import it. When we import a flat file lookup sourc e, the Designer invokes the Flat File Wizard. Cached or Un cached Lookup: We can check the option in Properties Tab to Cache to lookup or not. By default, lookup is cached.
We can use a static cache. clip_image053 2 . We can use a dynamic or static cache. If there is a match for the lookup condition. Lookup Source: . If there is a match for the lookup condition.the Power Center Server returns the result of the lookup condition into the return port. Cache includes all lookup/output ports in the lookup condition and the lookup/re turn port.LOOKUP T/F COMPONENTS Define the following components when we configure a Lookup transformation in a m apping: Lookup source Ports Properties Condition 1. the Power Center Server returns t he default value for all output ports. Supports user-defined default values Does not support user-defined default values. Cache includes all lookup columns used in the mapping. the Power Center Server returns th e result of the lookup condition for all lookup/output ports. Pass multiple output values to another transformation. the Power Center Server returns N ULL. Pass one output value to another transformation. Receives input values from the result of a :LKP expression in another transforma tion.Connected and Unconnected Lookup Connected Lookup Unconnected Lookup Receives input values directly from the pipeline. If there is no match for the lookup condition. If there is no match for the lookup condition.
We can use a flat file or a relational table for a lookup source. 3. The Designer automatically Designates each column in the lookup sou rce as a lookup (L) and output port (O). L Connected Unconnected Minimum 1 Lookup port. 2. Usually ports used for Join condition are Input ports. When we create a Lookup t/f. or we can join multiple tables in the same database using a lookup SQL override in Properties Tab. R Unconnected 1 Only Return port. O Connected Unconnected Minimum 1 Ports going to another transformation from Lookup. we can import the lookup source from the following locations: Any relational source or target definition in the repository Any flat file source or target definition in the repository Any table or file that both the Power Center Server and Client machine can c onnect to The lookup table can be a single table. Properties Tab . Ports: Ports Lookup Type Number Needed Description I Connected Unconnected Minimum 1 Input port to Lookup. Use only in unconnected Lookup t/f only.
Lookup Caching Enabled Flat File. Lookup Policy on Multiple Match Flat File. Relational Displays the lookup condition you set in the Condition tab. Relational Determines what happens when the Lookup transformation finds multiple rows that match the lookup condition. Connection Information Relational Specifies the database containing the lookup table. Source Type Flat File. Lookup Table Name Relational Specifies the name of the table from which the transformation looks up and cache s values. Options: Use First Value or Use Last Value or Use An y Value or Report Error Lookup Condition Flat File. Relational Indicates whether the Power Center Server caches lookup values during the sessio n. Relational .Options Lookup Type Description Lookup SQL Override Relational Overrides the default SQL statement to query the lookup table.
Lookup Cache Directory Name Flat File.Lookup is from a database or flat file. Lookup Data Cache Size Flat File. Relational . Recache From Lookup Source Flat File. Insert Else Update Relational Use only with dynamic caching enabled. Dynamic Lookup Cache Flat File. Relational Whether to use Dynamic Cache or not. Lookup Cache Persistent Flat File. Relational Index Cache Size Cache File Name Prefix Flat File. Applies to rows entering the Lookup trans formation with the row type of insert. Relational To rebuild cache if cache source changes and we are using Persistent Cache. Relational Data Cache Size Lookup Index Cache Size Flat File. Relational Whether to use Persistent Cache or not. Relational Location where cache is build.
Example: IN_DEPTNO = DEPTNO In_DNAME = 'DELHI' Tip: If we include more than one lookup condition. Specifies the file name prefix to use wit h persistent lookup cache files. Some other properties for Flat Files are: Date time Format Thousand Separator Decimal Separator Case-Sensitive String Comparison Null Ordering Sorted Input 4: Condition Tab We enter the Lookup Condition. clip_image131clip_image133 3. 2. Create a target table CONN_Lookup_EXAMPLE in target designer.Use only with persistent lookup cache. not an OR. When we enter multiple conditions. We can use = operator in case of Dynamic Cache. We compare transformation input values with values in the lookup source or cache. The Power Center Server uses the lookup condition to test incoming values. The input value must meet all conditions for the lookup to return a value. Create the shortcuts in your folder. Creating Mapping: 1. The Power Center Server matches null values. >. The Power Center Server fails the session when it encounters multiple keys fo r a Lookup transformation configured to use a dynamic cache. Open folder where we want to create the mapping. != Operators can be used. represented by lookup ports. place the conditions with an equal sign first to optimize lookup performance. Click Tools -> Mapping Designer. . Table should c ontain all ports of EMP table plus DNAME and LOC as shown below. DEPT will be LOOKUP table. <=. 2. =. >=. The data types in a condition must match. Note: 1. <. the Power Center Server evaluates each co ndition as an AND. Connected Lookup Transformation Example: To create a connected Lookup Transformation EMP will be source table.
The Following screen is displayed. 11. Link the mapping as shown below: 12. Now go to CONDITION tab and add CONDITION. Click Mapping-> Create-> Give name. SEE PROPERTY TAB FOR ADVANCED SETTINGS clip_image137 4. Designate a return value. 9. Repository -> Save Create Session and Workflow as described earlier. . Call the lookup from another transformation. clip_image135 10. Make sure to give connection information for all tables. Edit Lookup and rename it to IN_DEPTNO in ports tab. Steps to configure Unconnected Lookup: Add input ports. We are not passing IN_DEPTNO and DEPTNO to any other transformation from LOO KUP. Drag EMP and Target table. We write an expression using the :LKP reference qualifier to call the lookup within another transformation. We use Connected Lookup when we need to return more than one column from Lookup table. Mapping -> Validate 14. Ex: m_CONN_LOOKUP_EXAMPLE 4. Click Ok. Make sure to give connection for LOOKUP Table also. DEPTNO from SQ_EMP will be named as DEPTNO1. Unconnected Lookup Transformation An unconnected Lookup transformation is separate from the pipeline in the mappin g. click Source and then Select DEPT. 5.There is no use of Return Port in Connected Lookup. Run the workflow and see t he data in target table. 13. DEPTNO = IN_DEPTNO and Click Apply and then OK. Add the lookup condition. Connect all fields from SQ_EMP to target except DNAME and LOC. we can edit the lookup transformation and remove the OUTPUT check from them . Now Pass DEPTNO from SQ_EMP to this Lookup. 7. Give name and click Create. 8. 6. Transformation-> Create -> Select LOOKUP from list. As DEPT is the Source definition.3.
DEPTNO = IN_DEPTNO and Click Apply and then OK. Now Transformation-> Create -> Select EXPRESSION from list. we pass only DEPTNO as input. Now we need to call this Lookup from Expression Transformation. 8. 12. Go to Ports tab. Edit Expression t/f and create a new output port out_DNAME of data type as D NAME. Check on R to make it. Validate the call in Expression editor and Click OK. 13. Give name and click Create. 5. 15. Now add a condition in Condition Tab. Drag EMP and Target table. Ex: m_UNCONN_LOOKUP_EXAMPLE 4. 16. Table should contain all ports of EMP table plus DNAME as shown below. Transformation-> Create -> Select LOOKUP from list. Then Click Done. Follow the steps as in Connected above to create Lookup on DEPT table. 2.Example: To create a unconnected Lookup Transformation EMP will be source table. Make it Input port only and Give Datatype same as DEPTNO. 7. Click Ok. 17. 10. Click Tools -> Mapping Designer. 6. 11. create a port IN_DEPTNO ports tab. Designate DNAME as Return Port. 18. Click Mapping-> Create-> Give name. Open the Expression editor and call Lookup as given below: We double click Unconn in bottom of Functions tab and as we need only DEPTNO. Open folder where we want to create the mapping. clip_image139clip_image141 14. Create the shortcuts in your folder. DEPT will be LOOKUP table. Connect all fields from EXPRESSION to target except DNAME. As DEPTNO is common in source and Lookup. Mapping -> Validate . Creating Mapping: 1. Give name and click Create. 9. Now Edit the Lookup Transformation. 3. Create a target table UNCONN_Lookup_EXAMPLE in target designer. Pass all ports from SQ_EMP to EXPRESSION transformation.
stores data from the return port. the IS always caches the lookup source. we can configure the Looku p transformation to use a persistent lookup cache. The IS saves and reuses cache files from session to session. not including ports used in the lookup condition. 4. If the data does not fit in the memory cache. Repository Save. Persistent Cache If the lookup table does not change between sessions. Lookup Cache Files 1. The Integrat ion Service (IS) builds a cache in memory when it processes the first row of dat a in a cached Lookup transformation. For an unconnected Lookup transformation.T he IS does not update the cache while it processes the Lookup transformation. Create Session and Workflow as described earlier. stores data for the connected output ports. 3. IS releases cache memory and deletes the cache files. Lookup Caches We can configure a Lookup transformation to cache the lookup table.19. 2. the IS stores the overflow values in the cache files. No good for performance if table is huge. When session completes. use a Lookup transformation with a dynamic cache. Make sure to give connection for LOOKUP Table also. We set the Cache type in Lookup Properties. Types of Lookup Caches: 1. The Integration Service also creates cache files by default in the $PMCacheDir. Run the workflow and see t he data in target table. Recache from Source . Dynamic Cache To cache a target table or flat file source and insert new rows or update existi ng rows in the cache. Lookup Index Cache: Stores data for the columns used in the lookup condition. It caches the lookup file or table an d Looks up values in the cache for each row that comes into the transformation. Lookup Data Cache: For a connected Lookup transformation. Static Cache By default. If we use a flat file lookup. The IS dynamically inserts or updates data in the lookup cache and passes data t o the target. the IS creates a static cache. 2. Make sure to give connection information for all tables. eliminating the tim e Required to read the lookup table. Target table is also our lookup table. 5.
clip_image143clip_image145 5. Shared Cache Unnamed cache: When Lookup transformations in a mapping have compatible cac hing structures.com/2011/04/lookup-transf ormation.html#ixzz1nIgGxKZV Under Creative Commons License: Attribution Non-Commercial .If the persistent cache is not synchronized with the lookup table. Read more: http://informaticatutorials-naveen. Named cache: Use a persistent named cache when we want to share a cache fil e across mappings or share a dynamic and a static cache. we can use this to rebuild the lookup cache. You can share static and dynamic named caches. we can Config ure the Lookup transformation to rebuild the lookup cache.If Lookup table has ch anged.blogspot. You can only share static u nnamed caches. the IS shares the cache by default. The caching structures must match or be compatible with a named cache.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.