Assuming the values in one of the input parameter to a SQL feed is a comma separated list of values. The latter, for example,
could be generated from a multiple selection drop down or checkboxes.
DB2:http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.sql.ref.doc/doc/r0054097.html
Example:
db2 => select * from testTAB01
ID CENTER STATE
1 ABCD001 ca
2 ABCD002 mi
2 XYZZ010 OR
3 CDEF010 NV
4 EFGH1010 NM
5 record(s) selected.
db2 => select * from testTAB01 where center in ('ABCD001','CDEF010','EFGH1010')
ID CENTER STATE
1 ABCD001 ca
3 CDEF010 NV
4 EFGH1010 NM
3 record(s) selected.
Workaround for using this in MashupHub for feed creation:
db2 => select * from testTAB01 where INSTR( 'ABCD001,CDEF010,EFGH1010',center) > 0
ID CENTER STATE
1 ABCD001 ca
3 CDEF010 NV
4 EFGH1010 NM
3 record(s) selected.
Oracle: http://download.oracle.com/docs/cd/B28359_01/olap.111/b28126/dml_functions_1103.htm
Example:
SQL> select * from testTAB01;
ID CENTER ST
1 ABCD001 ca
2 ABCD002 mi
2 XYZZ010 OR
3 CDEF010 NV
4 EFGH1010 NM
SQL> select * from testTAB01 where INSTR( 'ABCD001,CDEF010,EFGH1010',center) > 0;
ID CENTER ST
1 ABCD001 ca
3 CDEF010 NV
4 EFGH1010 NM
SQL Server:
http://msdn.microsoft.com/en-us/library/ms186323.aspx
Example:
select * from testTAB01
id center state
1 ABCD001 ca
2 ABCD002 mi
2 XYZZ010 OR
3 CDEF010 NV
4 EFGH1010 NM
select * from testTAB01 where CHARINDEX( center,'ABCD001,CDEF010,EFGH1010') >0;
id center state
1 ABCD001 ca
3 CDEF010 NV
4 EFGH1010 NM
As shown above the String ''ABCD001,CDEF010,EFGH1010' is the comma separated values that would typically be used in an IN clause to return all matching rows. In all the examples the workaround performs the same function. Creating feeds using the same SQL and declaring the relevant url param, this String value can now be dynamic by passing them via the URL param during feed execution.
Example:
select * from testTAB01 where INSTR( ':cparam',center) > 0
In the above SQL, the 'cparam' declared as the query param to which one can pass the comma separated list of values during feed execution.
As a note if the column values are not distinct, one will have to tune the query to use other supported database functions and get the desired result.