Why lookup transformation in informatica




















Lookup transformation is a passive transformation used to look up a source, source qualifier, or target to get the relevant data. Step 4 — Lookup transformation will be created with the columns of DEPT table, now select done button.

Step 6 — Double click on the lookup transformation. Then in the edit transformation window. Now, save the mapping and execute it after creating the session and workflow.

This mapping will fetch the department names using lookup transformation. The unconnected Lookup transformation returns one column to the calling transformation. Cached or uncached lookup. Cache the lookup source to improve performance. If you cache the lookup source, you can use a dynamic or static cache. By default, the lookup cache remains static and does not change during the session. With a dynamic cache, the Integration Service inserts or updates rows in the cache.

When you cache the target table as the lookup source, you can look up values in the cache to determine if the values exist in the target. The Lookup transformation marks rows to insert or update the target. Lookup Source Types When we create a Lookup transformation, we can choose a relational table, flat file, or a source qualifier as the lookup source.

Relational Lookups When we create a Lookup transformation using a relational table as a lookup source, we can connect to the lookup source using ODBC and import the table definition as the structure for the Lookup transformation. Sort null data high or low, based on database support. Perform case-sensitive comparisons based on the database support. Flat File Lookups When we create a Lookup transformation using a flat file as a lookup source, select a flat file definition in the repository or import the source when you create the transformation.

When you import a flat file lookup source, the Designer invokes the Flat File Wizard. Use the following options with flat file lookups: Use indirect files as lookup sources by configuring a file list as the lookup file name.

Use sorted input for the lookup. Sort null data high or low. Use case-sensitive string comparison with flat file lookups.

Using Sorted Input When we configure a flat file Lookup transformation for sorted input, the condition columns must be grouped. If the condition columns are not grouped, the Lookup transformation returns incorrect results. For optimal caching performance, sort the condition columns. The Integration Service can cache the data, but performance may not be optimal. If we choose sorted input for indirect files, the range of data must not overlap in the files. Connected and Unconnected Lookups We can configure a connected Lookup transformation to receive input directly from the mapping pipeline, or you can configure an unconnected Lookup transformation to receive input from the result of an expression in another transformation.

The following table lists the differences between connected and unconnected lookups: Connected Lookup Unconnected Lookup Receives input values directly from the pipeline.

Receives input values from the result of a :LKP expression in another transformation. Use a dynamic or static cache. Use a static cache. Cache includes the lookup source columns in the lookup condition and the lookup source columns that are output ports.

Can return multiple columns from the same row or insert into the dynamic lookup cache. Designate one return port R. Returns one column from each row. If there is no match for the lookup condition, the Integration Service returns the default value for all output ports. If you configure dynamic caching, the Integration Service inserts rows into the cache or leaves it unchanged.

If you configure dynamic caching, the Integration Service either updates the row the in the cache or leaves the row unchanged. If there is a match for the lookup condition, the Integration Service returns the result of the lookup condition into the return port. Pass multiple output values to another transformation. Pass one output value to another transformation. Supports user-defined default values. Does not support user-defined default values. Connected Lookup Transformation The following steps describe how the Integration Service processes a connected Lookup transformation: A connected Lookup transformation receives input values directly from another transformation in the pipeline.

For each input row, the Integration Service queries the lookup source or cache based on the lookup ports and the condition in the transformation. If the transformation is uncached or uses a static cache, the Integration Service returns values from the lookup query.

If the transformation uses a dynamic cache, the Integration Service inserts the row into the cache when it does not find the row in the cache. When the Integration Service finds the row in the cache, it updates the row in the cache or leaves it unchanged.

It flags the row as insert, update, or no change. The Integration Service passes return values from the query to the next transformation. If the transformation uses a dynamic cache, you can pass rows to a Filter or Router transformation to filter new rows to the target. Note: This chapter discusses connected Lookup transformations unless otherwise specified. Unconnected Lookup Transformation An unconnected Lookup transformation receives input values from the result of a :LKP expression in another transformation.

You can call the Lookup transformation more than once in a mapping. A common use for unconnected Lookup transformations is to update slowly changing dimension tables. The following steps describe the way the Integration Service processes an unconnected Lookup transformation: An unconnected Lookup transformation receives input values from the result of a :LKP expression in another transformation, such as an Update Strategy transformation.

The Integration Service queries the lookup source or cache based on the lookup ports and condition in the transformation. The Integration Service returns one value into the return port of the Lookup transformation. The Lookup transformation passes the return value into the :LKP expression. Lookup Components Define the following components when you configure a Lookup transformation in a mapping: Lookup source Ports Properties Condition Lookup Source We use a flat file, relational table, or source qualifier for a lookup source.

When you create a Lookup transformation, you can create the lookup source from the following locations: Relational source or target definition in the repository Flat file source or target definition in the repository Table or file that the Integration Service and PowerCenter Client machine can connect to Source qualifier definition in a mapping The lookup table can be a single table, or you can join multiple tables in the same database using a lookup SQL override.

The Integration Service queries the lookup table or an in-memory cache of the table for all incoming rows into the Lookup transformation. Configure native drivers for optimal performance. Indexes and a Lookup Table If you have privileges to modify the database containing a lookup table, you can improve lookup initialization time by adding an index to the lookup table.

You can improve performance for very large lookup tables. Since the Integration Service queries, sorts, and compares values in lookup columns, the index needs to include every column in a lookup condition. You can improve performance by indexing the following types of lookup: Cached lookups. Uncached lookups. Because the Integration Service issues a SELECT statement for each row passing into the Lookup transformation, you can improve performance by indexing the columns in the lookup condition.

Lookup Ports The Ports tab contains input and output ports. The Ports tab also includes lookup ports that represent columns of data to return from the lookup source. An unconnected Lookup transformation returns one column of data to the calling transformation in this port. An unconnected Lookup transformation has one return port.

Create an input port for each lookup port you want to use in the lookup condition. O Connected Unconnected Output port. Create an output port for each lookup port you want to link to another transformation. You can designate both input and lookup ports as output ports. For connected lookups, you must have at least one output port. For unconnected lookups, select a lookup port as a return port R to pass a return value. L Connected Unconnected Lookup port. The Designer designates each column in the lookup source as a lookup L and output port O.

R Unconnected Return port. Use only in unconnected Lookup transformations. Designates the column of data you want to return based on the lookup condition. You can designate one lookup port as the return port.

The Lookup transformation also enables an associated expression property that you configure when you use a dynamic cache.

The associated expression property contains the data to update the lookup cache. It can contain an expression to update the dynamic cache or it can contain an input port name. Use the following guidelines to configure lookup ports: If you delete lookup ports from a flat file lookup, the session fails. You can delete lookup ports from a relational lookup if the mapping does not use the lookup port. This reduces the amount of memory the Integration Service needs to run the session.

Lookup Properties Configure the lookup properties such as caching and multiple matches on the Lookup Properties tab. Configure the lookup condition or the SQL statements to query the lookup table.

We can also change the Lookup table name. When we create a mapping, we configure the properties for each Lookup transformation. When we create a session, we can override properties such as the index and the data cache size for each transformation. Use with the lookup cache enabled. Lookup Table Name Pipeline Relational The name of the table or the source qualifier from which the transformation looks up and caches values.

When you create the Lookup transformation, choose a source, target, or source qualifier as the lookup source. You can also import a table, view, or synonym from another database when you create the Lookup transformation.

Lookup Source Filter Relational Restricts the lookups the Integration Service performs based on the value of data in any port in the Lookup transformation. When you enable lookup caching, the Integration Service queries the lookup source once, caches the values, and looks up values in the cache during the session. Caching the lookup values can improve session performance. When you disable caching, each time a row passes into the transformation, the Integration Service issues a select statement to the lookup source for lookup values.

Note: The Integration Service always caches the flat file lookups and the pipeline lookups. Lookup Policy on Multiple Match Flat File Pipeline Relational Determines which rows to return when the Lookup transformation finds multiple rows that match the lookup condition. Select one of the following values: Report Error. The Integration Service reports an error and does not return a row.

Use First Value. Returns the first row that matches the lookup condition. Use Last Value. Return the last row that matches the lookup condition. Use All Values. Return all matching rows. Use Any Value. The Integration Service returns the first value that matches the lookup condition. It creates an index based on the key ports instead of all Lookup transformation ports. Report Error.

Connection Information Relational Specifies the database that contains the lookup table. You can define the database in the mapping, session, or parameter file: Mapping. Select the connection object. You can also specify the database connection type. Type Relational:before the connection name if it is a relational connection. Type Application:before the connection name if it is an application connection.

If you use one of these variables, the lookup table must reside in the source or the target database. Specify the database connection in the session properties for each variable.

Parameter file. You can override these values in the session properties. The Integration Service fails the session if it cannot determine the type of database connection. Source Type Flat File Pipeline Relational Indicates that the Lookup transformation reads values from a relational table, flat file, or source qualifier. Lookup Cache Directory Name Flat File Pipeline Relational Specifies the directory used to build the lookup cache files when you configure the Lookup transformation to cache the lookup source.

Also saves the persistent lookup cache files when you select the Lookup Persistent option. Lookup Cache Persistent Flat File Pipeline Relational Indicates whether the Integration Service uses a persistent lookup cache, which consists of at least two cache files. If a Lookup transformation is configured for a persistent lookup cache and persistent lookup cache files do not exist, the Integration Service creates the files during the session. Indicates the maximum size the Integration Service allocates to the data cache and the index in memory.

You can configure a numeric value, or you can configure the Integration Service to determine the cache size at run time. If you configure the Integration Service to determine the cache size, you can also configure a maximum amount of memory for the Integration Service to allocate to the cache. If the Integration Service cannot allocate the configured amount of memory when initializing the session, it fails the session.

When the Integration Service cannot store all the data cache data in memory, it pages to disk. Inserts or updates rows in the lookup cache as it passes rows to the target table. When the Integration Service updates a row in the cache, it outputs the value that existed in the lookup cache before it updated the row based on the input data.

When the Integration Service inserts a row in the cache, it outputs null values. This property is enabled by default. Create an expression using lookup ports or input ports. The expression can contain input values or values in the lookup cache.

The Integration Service updates the cache when the condition is true and the data exists in the cache. Use with dynamic caching enabled. Default is true. Specifies the file name prefix to use with persistent lookup cache files.

The Integration Service uses the file name prefix as the file name for the persistent cache files it saves to disk. Enter the prefix. Do not enter. You can enter a parameter or variable for the file name prefix. Use any parameter or variable type that you can define in the parameter file.

If the named persistent cache files exist, the Integration Service builds the memory cache from the files. If the named persistent cache files do not exist, the Integration Service rebuilds the persistent cache files. When selected, the Integration Service rebuilds the lookup cache from the lookup source when it first calls the Lookup transformation instance.

If you use a persistent lookup cache, it rebuilds the persistent cache files before using the cache. If you do not use a persistent lookup cache, it rebuilds the lookup cache in the memory before using the cache.

Applies to rows entering the Lookup transformation with the row type of insert. When enabled, the Integration Service inserts rows in the cache and updates existing rows When disabled, the Integration Service does not update existing rows. Applies to rows entering the Lookup transformation with the row type of update. When enabled, the Integration Service updates existing rows, and inserts a row if it is new. When disabled, the Integration Service does not insert new rows.

Define the format and the field width. Milliseconds, microseconds, or nanoseconds formats have a field width of If you do not select a datetime format for a port, you can enter any datetime format. The Datetime format does not change the size of the port. Thousand Separator Flat File If you do not define a thousand separator for a port, the Integration Service uses the properties defined here.

You can choose no separator, a comma, or a period. Default is no separator. Decimal Separator Flat File If you do not define a decimal separator for a particular field in the lookup definition or on the Ports tab, the Integration Service uses the properties defined here. You can choose a comma or a period decimal separator.

Default is period. For relational lookups, the case sensitive comparison depends on the database support. You can choose to sort null values high or low.

By default, the Integration Service sorts null values high. This overrides the Integration Service configuration to treat nulls in comparison operators as high, low, or null. For relational lookups, null ordering depends on the database default value.

This increases lookup performance for file lookups. If you enable sorted input, and the condition columns are not grouped, the Integration Service fails the session. If the condition columns are grouped, but not sorted, the Integration Service processes the lookup as if you did not configure sorted input. The Integration Service can build multiple lookup cache files at the same time to improve performance.

You can configure this option in the mapping or the session. The Integration Service uses the session-level setting if you configure the Lookup transformation option as Auto. Configure one of the following options: Auto. The Integration Service uses the value configured in the session. Always allowed.

The Integration Service can build the lookup cache before the Lookup transformation receives the first source row. The Integration Service creates an additional pipeline to build the cache. Now a new window will be opened to create target table, Enter a new name for this target table and select the database as Oracle.

Our target table has been created successfully, now we have to edit the table to add new columns by renaming the column names. Navigate to Columns and click on Add new column icon as shown below. As shown above, our target table in Lookup Transformation in Informatica has six ports after creating click on OK button, then the target table will be appeared in the workspace as shown below.

Click on OK button, now drag and drop the source and target tables in to the workspace are of mapping window as shown below. Now go to transformation tab to create Lookup transformation in Informatica PowerCenter. Go to transformation tab and click on create button. Now select Lookup transformation type and enter a new name for the transformation. The remaining process for creating the Session, creating the Workflow is same.

Informatica Introduction. Informatica Tutorial - Home. What is Informatica? Informatica - Architecture. Informatica - PowerCenter Repository Service. What is PowerCenter Repository Manager. What is informatica PowerCenter Designer? Informatica - DTM Threads. Informatica - Load Balancing. Different ETL tools in Informatica.

What is Mapping architect for Visio? Informatica - PowerCenter Informatica - Creating Integration Service. Creating Informatica Repository Service. For example, the source has an employee ID. Retrieve the employee name from the lookup table. Get multiple values. Retrieve multiple rows from a lookup table. For example, return all employees in a department. Update slowly changing dimension tables.

Determine whether rows exist in a target. You can perform the following types of lookups: Connected or unconnected lookup. A connected Lookup transformation receives source data, performs a lookup, and returns data.

An unconnected Lookup transformation is not connected to a source or target. A transformation calls the Lookup transformation with a lookup expression. The unconnected Lookup transformation returns one column to the calling transformation.



0コメント

  • 1000 / 1000