Using a JDBC query with an SQL statement with "IN" ("NOT IN") in the "where" clause.

Using a JDBC query with an SQL statement with "IN" ("NOT IN") in the "where" clause.

book

Article ID: KB0084499

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
To use the JDBC Query activity with the "IN" or "NOT IN" parameter in the "where" clause, you need to have as many bind variables as your "IN" ("NOT IN") clause values.

For example to call: 

select * from <someTable> where alpha_id in "'a','b','c'" 

you need to have three Prepared parameters, in the mapper input put every variable separately and the SQL statement like the following:

select * from <someTable> where alpha_id in (?,?,?)

If you need the number of "IN" ("NOT IN") values to be dynamic you can use the SQL Direct activity and ('a','b','c') string as the input parameters list.

Issue/Introduction

Using a JDBC query with an SQL statement with "IN" ("NOT IN") in the "where" clause.