DatabaseLookup - 6.3

Talend Data Mapper User Guide

Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
Design and Development
Talend Studio




Looks up a value in a database.


The DatabaseLookup function returns a single value of the specified column that satisfies the specified condition.

Only certain functions are translated into SQL for evaluation by the database and can be used with DatabaseColumn and DatabaseFunction functions. These are:

  • Add

  • And

  • Concat

  • Constant

  • Divide

  • Multiply

  • Or

  • Subtract

  • Not

That is to say that the DatabaseColumn and DatabaseFunctions must only be children of one of the above functions.

You can also use any function as part of the expression tree to reference elements from your map. You just can't have the DatabaseColumn or DatabaseFunction be a child of functions other than on the list above.

Return Type

Depends on the database column specified


Output Column

The fully qualified column whose value is to be returned by this function. The specification is of the form: <path to database>.<table>.<column> for example: /Default Project/Databases/MyDatabase.MYTABLE.MYCOLUMN. Note that when using the studio a graphical interface specifies this, so you don't need to be concerned with this format.


Cache Lookups?

Specifies if the values returned by this function are cached. Possible values are:

  • DEFAULT - cache according to the caching policy of the runtime

  • ALWAYS - always cache regardless of the runtime setting

  • NEVER - never cache values regardless of the runtime setting

The runtime also has a cache timeout value which invalidates cached items after the expiration of the timeout value.


Condition (Boolean)

The "where" condition for this lookup. This is an expression that includes DatabaseColumn (and maybe DatabaseFunction) functions to specify to the database the selection criteria for the lookup. Use the normal functions for specifying conditions (e.g. Equal, And, Add). These functions will be translated into the corresponding SQL for evaluation by the database. You may use any other type of function in the Condition as well to refer to elements in the map for example.


Output Column (String)

The output column to select. This is mainly used when you want to use a function with the output column. For example, selecting the maximum value of a column. Use a DatabaseFunction to specify the function and a single DatabaseColumn within that to specify the column.