Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Parameterize SQL table names

BChartrand
5 - Atom

Hello!  I have a common process that I run on multiple tables within a database and want to build an analytics app that would allow my users to change the table name as needed.

 

I have built a process that uses actions with an update string, but the process won't run because Alteryx is trying to validate my query and it is pointing to a table that doesn't exist.

 

My query looks something like:

Select * from 'parameter1'_'parameter2'_data 

 

Writing this, I realize that I could point it to a table that does exist and overwrite the strings for that table, but if that table would ever get dropped my process would stop working and I would like to avoid that if possible.

 

Thoughts?

 

Update:  Pointing to a table that already exists doesn't work since it is not technically a string the replace doesn't replace and making the parameters strings causes the same failure.

3 REPLIES 3
BChartrand
5 - Atom

Update #2: Was able to get the string replace to work by replacing the entire table name.  I had to create the full table name in a formula and use that as an input into my workflow.

BChartrand
5 - Atom

I was able to solve this using a dynamic input tool being fed by a text input tool that has actions.

 

For development, I can test my workflow by updating the values in the text input tool and keeping my parameters in the workflow don't have to worry about going back and updating them.

 

Example workflow attached.

rshah7255
5 - Atom

I don't see any sample workbook. Can you please attach the workbook?

Labels