Skip to main content

Lookup values in an external datasource

The Lookup values in an external datasource (SqlQueryMapping) mapping is used to execute a parameterized SQL query against an external database using a value from the incoming message. This mapping allows you to enrich the message with data fetched from a database.

Required Attributes

AttributeRequiredDescription
FromYesField in the message whose value will be used as the SQL parameter.
ToYesField where the result of the query will be stored.
PrecedenceYesDetermines the order in which this mapping is applied relative to others.
Function TypeYesMust be "Enrichment/lookup functons"
FunctionYesNeeds to be "lookup values in an external datasource"
connectionstringYesJDBC connection string to the target database.
userNoUsername for database authentication.
passwordNoPassword for database authentication.
queryYesSQL query with a single ? placeholder for the parameter.
note

The SQL must contain exactly one ? placeholder, which will be replaced by the value from de from field at runtime.