| ID | NAME |
| 25 | orange |
| 26 | banana |
| 27 | strawberry |
| 28 | pineapple |
| 29 | blueberry |
| 30 | kiwi |
| 31 | apple |
| 32 | pear |
| 33 | watermelon |
SELECT * FROM TEST WHERE NAME IN ('orange','banana');
We want this array of elements inside the IN clause to be passed as a parameter, as the value will be taken dynamically inside our flow. Following the parametrization logic, the SQL statement would be like this:
SELECT * FROM TEST WHERE NAME IN (:inClauseParameters);But this doesn't work as JDBC connections don't support parameterization. So, we need to generate and pass this parameters dynamically.
%dw 2.0 output application/java --- payload map ":arg$$" reduce ((item, accumulator) -> accumulator ++ ", " ++ item)This will generate
:arg0, :arg1
%dw 2.0
output application/java
---
payload map {"arg$$" : $} reduce ((item, accumulator = {}) -> item ++ accumulator)
This will generate:
{
"arg1": "orange",
"arg0": "banana"
}
001114543

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.