You are on page 1of 2

Data Services - Types of Lookup Functions

As promised last week, here I am with the details of the types of loopup functions. As I mentioned
earlier, there are three types of lookup functions:

i. Lookup
ii. Lookup_seq
iii. Lookup_ext (most widely used)
Lookup is the basic plain-vanilla type, which helps you lookup values but is not as rich as its peers
in terms of the options provided.
Lookup_Seq searches in matching records to return a field from the record where the sequence
column satisfies the given conditional operator logic.
Lookup_ext is the most widely used function and it provides us with a number of options such as
being able to specify the return policy, order by logic, caching mechanism, optimization as well as
being able to return multiple columns.
Following are the function parameters, in that order:
a. translate_table - Table which the lookup function will be using; D_EMAIL in the previous post
b. cache_spec - Caching method used by the lookup function. Options pre_load_cache, no_cache,
demand_load_cache
Pre_Load_Cache - used when the dataset is small and the probability of using a high percentage
of rows
Demand_Load_Cache - used when the dataset is huge and the rows being considered for the
current
operation is low
c. return_policy - used to specify if the value return should be the Max or Min, other options include
max-ns and min-ns which include nulls
d. return_column_list - list of columns to be returned
e. default_value_list - specifies the default value when there are no matching records
f. condition_list - specifies the conditional list
g. orderby_column_list - columns in the translate table you want to order the resulting records on
h. output_variable_list - list of output variables to be returned
i. sql_override - used to provide a sql statement to populate a lookup when pre_load_cache is
specified
Where are you going to make use of the lookup function? For demo purpose, open the query
transform within your data-flow and right-click on the ID column on the target side and select "Add
new function call". Within the wizard that open, select the Lookup Functions category and then select
the lookup_ext function and click Next >
Clicking on next bring you to the following designer where you select the options:

http://balne-sap.blogspot.in/2012/05/data-services-types-of-lookup-functions.html

You might also like