Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Oracle Passing Multiple parameter values into a single bind variable

dhanemkulas
5 - Atom

From Designer, I am connecting to Oracle DB. I have a requirement to pass multiple values into a Bind Variable.

I am using Dynamic Input to Load the sql and using the 'Text to Replace' to pass the parameter values.  When I pass a single value, it works correctly. My requirement is to pass multiple values.

Think of it as trying to pass zip codes as parameter values to determine the number of residents.  Sometimes, I may pass one value or I may pass multiple values.

 

The below sub query works well in SQL tool,

 

AND ZipCode IN
(SELECT regexp_substr(:Enter_Zip, '[^,]+', 1, LEVEL) token
FROM dual
CONNECT BY LEVEL <= length(:Enter_Zip) - length(REPLACE(:Enter_Zip, ',', '')) + 1
)

 

but when executing in Alteryx, it throws our an error error: ORA-00920: invalid relational operator (Tool Id: 20)

 

Appreciate your inputs and suggestions.

 

3 REPLIES 3
BrandonB
Alteryx
Alteryx

What if you have the query in a text input tool, make the required updates via a formula tool, and then have the Dynamic Input tool swap out the entire query? Sometimes this can be an easier approach. 

dhanemkulas
5 - Atom

Hi Brandon,

 

Thank you for the response.

dhanemkulas_0-1631031997855.png

 

What properties are to be used to update the parameter value in the query usig formula .

 

dhanemkulas_1-1631032159224.png

 

Is there a demo work flow that I can leverage to test this solution out.

 

BrandonB
Alteryx
Alteryx

You could use Replace([Query], "value to be replaced", [Upstream Field to swap value in]). You won't need to use an interface tool for this purpose as you can just load the values into the Text Input tool and then use a formula following for the replacement values. Then if you do want to make it an analytic app you can just use the interface tools to update the Text Input and all of the downstream logic will follow. 

 

 

Labels
Top Solution Authors