I am trying to build an app where someone can use a list box to select multiple parameters for a WHERE clause of a SQL query. I am familiar with using the Dynamic Input tool to update a WHERE IN clause, but WHERE IN doesn't work with LIKE, so I need to update code similar to the following:
WHERE [Table].[Column] LIKE ABCD% or [Table].[Column] LIKE EFGH% ...et cetera
What I want is for the user to select from a list box the conditions for their query, e.g. the list box includes ABCD, EFGH, IJKL, and MNOP, and the user selects which ones they want. (Let's say they choose ABCD and EFGH.) Then instead of feeding directly into an Action tool, the workflow takes the selections from the list box, does a crosstab, creates a string out of the fields (e.g. "[Table].[Column]. LIKE "+[Field1]+"% or "+"[Table].[Column]. LIKE "+[Field2]+"%", which yields [Table].[Column] LIKE ABCD% or [Table].[Column] LIKE EFGH%), and then uses the Action tool to replace a specific string in the SQL query (the WHERE clause to be precise).
I am trying to take this approach, but it seems like I can't take the selections from the list box and create a string with the LIKE operator that then feeds into the SQL query.
Does anyone have any strategies for customizing a SQL query WHERE clause with multiple LIKE operators?