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
| Attribute | Required | Description |
|---|---|---|
| from | Y | Field in the message whose value will be used as the SQL parameter. |
| to | Y | Field where the result of the query will be stored. |
| Function type | Y | Must be "Enrichment/lookup functions". |
| Function | Y | Needs to be "lookup values in an external datasource" |
| connectionstring | Y | JDBC connection string to the target database. |
| user | N | Username for database authentication. |
| password | N | Password for database authentication. |
| query | Y | SQL 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.