Informatica Dynamic Lookup
Informatica Dynamic Lookup
Description:
BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Guide for building financial data model in Informatica. The document focuses on how the real world requirement should be interpreted. The mapping document template with very simplified steps and screen shots makes the complete learning so easy. The document focuses on how to Dynamic Lookup. Join our professional training program and learn from experts.
History:
Author
www.bispsolutions.com Page 1
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Table of Contents
Table of Contents...............................................................................................................................................2 TYPES .............................................................................................................................................................3 Connected and Unconnected Lookup .......................................................................................................3 Step by step process for creating Dynamic lookup transformation...............................................................9 Creating Workflow...........................................................................................................................................24 Execute Workflow, Review data and Check log File.........................................................................................32
www.bispsolutions.com Page 2
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Introduction: Lookup transformation is Passive and it can be both Connected and Unconnected as
well. It is used to look up data in a relational table, view, or synonym. Lookup definition can be imported either from source or from target tables.
TYPES
We can configure the Lookup transformation to perform the following types of lookups: Relational or Flat File Cached or Un cached Connected or Unconnected
We can override the default SQL statement if we want to add a WHERE clause or 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 source, 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.
www.bispsolutions.com Page 3
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Dynamic Lookups are used for implementing change When static checked it assumes that the lookup the value during the session run source is not going to change the value during the session run.
Uses
Get related values. Verify if records exists or if data has changed.
Importing Source and Target Table: Import data from source and create target table (There are
two types to create target table, Manually or import from database). There are following step to importing source and target database (Table). Step-1 Click on Start > All Programs > Informatica 9.0.1 > Client > Power Center Client> Power Center Designer.
Step-2 Then Connect to Repository in Informatica Power Center Designer Right click on repository name and click on Connect.
Step-3 Go to Tools Menu and click on Source Analyzer to import source table.
www.bispsolutions.com Page 4
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-5 And then select Source menu and click on Import from database. In Source menu, some another option available such as Import from File(Flatfile), Import from Cobol File and Import XML Definition.
Step-6 Specify Username, Owner name, password and click on connect. Then select source table and click OK.
Step-7 View data in source analyzer, Right click on SRC_CREDITCARD and select Preview Data. www.bispsolutions.com Page 5 | www.hyperionguru.com | weblogicexperts.wordpress.com|
Step-8 Specify Username and Password and connect it. Then Close it.
Step-9 Now click on Target Designer. Step-10 And then select Target menu and click on Import from database to import target table.
Step-11 Specify Username, Owner name, password and then click on connect and then select table and then OK.
www.bispsolutions.com Page 6
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-12 To view data select table and Right click on that table after that specify Username and Password and connect it. Then Close it.
www.bispsolutions.com Page 7
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 8
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Mappings represent the data flow b/w sources to targets. When the Informatica Power Center Server executes a session, it uses the instructions configured in the mapping to read, transform, and write data.
Every mapping must contain the following components: Source definition: It describes the characteristics of a source. Transformation: A transformation is a repository object which reads the data, modifies the data and passes the data. Transformations in a mapping represent the operations that the integration service performs on the data. Target definition: It describes the target table. Step by step process for creating Dynamic lookup transformation.
Step-1 Go to Mapping Designer and Create New Mapping and then name of mapping and click OK.
Step-2 Then drag and drop source table in Mapping Designer Window.
Step-3 Then drag and drop target table into mapping designer windows (Two times).
www.bispsolutions.com Page 9
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-4 And Edit target table name, right click on target table and select Edit, Then rename both target table.
www.bispsolutions.com Page 10
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 11
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 12
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-6 Then Create lookup transformation, select Lookup in dropdown and give name of lookup transformation and the click Create, after that select lookup table for Lookup Transformation and click OK. then click Done.
Select Lookup table from Target Designer Window. Select Lookup from Source Qualifier
Lookup table.
www.bispsolutions.com Page 13
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
passes source columns into lookup table. Step-9 Now, Right click on Lookup table and select Edit. Right click on Lookup Table.
Ports Mixed. "L" denotes lookup port. "R" denotes port used as a return value (Unconnected Lookup only).
www.bispsolutions.com Page 14
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Lookup
Step-11 Then go to condition tab and apply lookup condition and then click OK..
www.bispsolutions.com Page 15
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Lookup SQL Override: Write, SQL override query or default SQL query. Lookup table name: Lookup table name. Lookup Source Filter: We can apply filter conditions on the lookup table Lookup caching enabled: If cache option is checked, it caches the lookup table during the session run. Lookup policy on multiple match: Option is not available when using dynamic lookup cache. But when lookup integration service finds multiple match we can configure the lookup to return the First Value, Last Value, Any Value or to Report Error. Lookup condition: The condition to lookup values from the lookup table based on source input data. For example, BANK_CD = BANK_CD1. Connection Information: Query the lookup table from the source or target connection. In case of flat file lookup we can give the file path and name, whether direct or indirect. Source Type: Specify source types Tracing Level: It provides the amount of detail in the session log for the transformation. Options available are Normal, Terse, Verbose Initialization, Verbose Data. Lookup cache directory name: Determines the directory name where the lookup cache files will reside. Lookup cache persistent: Indicates whether we are going for persistent cache or non-persistent cache. Dynamic Lookup Cache: When checked We are going for Dynamic lookup cache else static lookup cache is used. Output Old Value On Update: Defines whether the old value for output ports will be used to update an existing row in dynamic cache. Cache File Name Prefix: Lookup will used this named persistent cache file based on the base lookup table. Re-cache from lookup source: When checked, integration service rebuilds lookup cache from lookup source when the lookup instance is called in the session. Insert Else Update: Insert the record if not found in cache, else update it. Option is available when using dynamic lookup cache. Update Else Insert: Update the record if found in cache, else insert it. Option is available when using dynamic lookup cache. Date time Format: Option is not available when using dynamic lookup cache. Used when source type is file to determine the date and time format of lookup columns. Thousand Separator: Option is not available when using dynamic lookup cache . By default it is None, used when source type is file to determine the thousand separator. Decimal Separator: By default it is "." else we can use "," and used when source type is file to determine the thousand separator. Case Sensitive String Comparison: To be checked when we want to go for Case sensitive String values in lookup comparison. Used when source type is file. Null ordering: Determines whether NULL is the highest or lowest value. Used when source type is file. Sorted Input: Checked for the input sorted. Lookup source is static: When checked it assumes that the lookup source is not going to change during the session run. Pre-build lookup cache: Default option is Auto. If we want the integration service to start building the cache whenever the session just begins we can chose the option Always allowed. | www.hyperionguru.com | weblogicexperts.wordpress.com|
www.bispsolutions.com Page 16
Step-13 Then, Create Router Transformation, Select router transformation and name of router transformation and click on Create.
www.bispsolutions.com Page 17
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 18
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 19
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-16 Go to Groups tab and create two group one for Insert and another for Update. and write SQL query for both group.
Step-17 Then create Update Strategy transformation and give name of transformation and click apply.
www.bispsolutions.com Page 20
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-18 Then passes all Update group column into Update Strategy Transformation.
Step-19 Then right click on Update Strategy table and select Edit.
Update strategy:
Transformation is an active and connected transformation. Update strategy transformation is used to insert, update, and delete records in the target table. It can also reject the records without reaching the target table. When you design a target table, you need to decide what data should be stored in the target. Step-20 Then go to Properties tab and write Update Strategy Expression.
www.bispsolutions.com Page 21
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-21 Them Create Mapping. (Insert group in router transformation table to map TRG_BANK_CD_INSERT and Update Strategy table to map with TRG_BANK_CD_UPDATE)
with
www.bispsolutions.com Page 22
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 23
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Creating Workflow
Workflow Manager: Workflow load the data between source to target b/w sequential manner. And also Define run-time properties for a mapping, known as sessions.
Step-1 Go to task developer and then click on Task Menu to create reusable task (Reusable tasks means the task that is created in task developer and create once time and used multiple times.)
www.bispsolutions.com Page 24
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-4 Now go to workflow designer and click on workflow menu to create workflow. Specify name of workflow and click OK.
www.bispsolutions.com Page 25
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-5 Now drag and drop lookup task into workflow designer windows.
Step-6 Now create flow B/W Workflow to Task. Select Line Task and link to Start to Filter.
Step-8 Now Configure Connection to Target, Then Right Click on Expression and Edit, Then Click Mapping tab and configure connection for your Target table schema in oracle 11g RDBMS. And then click OK.
www.bispsolutions.com Page 26
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 27
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 28
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-11 In Config Object. Specify Advance configuration, Log Options, Error handing, Partitioning Option.
www.bispsolutions.com Page 29
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Insert: Check this option to insert a row in the target table. Delete: Check this option to delete a row in the target table. Truncate Table: check this option to truncate the target table before loading the data. Update as Update: Update the row in the target table. Update as Insert: Insert the row which is flagged as update. Update else Insert: If the row exists in the target table, then update the row. Otherwise, insert the row.
www.bispsolutions.com Page 30
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 31
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
First time update all data in target table. www.bispsolutions.com Page 32 | www.hyperionguru.com
Step-5 Then Start Workflow, Right click on Workflow Designer Window and Click on Start Workflow.
www.bispsolutions.com Page 33
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 34
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Step-7 Now right click on session and select Get Session Log.
www.bispsolutions.com Page 35
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Lookup Condition.
www.bispsolutions.com Page 36
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Lookup query.
www.bispsolutions.com Page 37
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
Details.
www.bispsolutions.com Page 38
| www.hyperionguru.com
| weblogicexperts.wordpress.com|
www.bispsolutions.com Page 39
| www.hyperionguru.com
| weblogicexperts.wordpress.com|