Hi,
I have a workflow with 3 input tools, and 4 dynamic input tools that I generalized to work on both a production database and a testing database to stop older versions of the workflow from being used for testing due to the numerous hand edits that used to be required.
Unfortunately, the schema names are different. Currently all 7 tools have preSQL statements that do an "ALTER SESSION SET CURRENT_SCHEMA=PROD_SCHEMA" et cetera 7 times which is much better than the old hand edit method. When I want to run it in testing I have to do 7 input tool PreSQL updates to change it.
After spending a couple hours searching the forums and Google it seems like the only options to automate this more are either redesigning the workflow to use a macro as the input tools that I pass the static and dynamic SQL to along with the correct preSQL - OR - turn it into an Analytic app with user inputs and action tools that can update the PreSQL. This seems a bit like swatting flies with toothpicks.
Unfortunately the Analytic app isn't an option for me as in Production use, it's a scheduled workflow that downloads data to another location. I only want to modify the PreSQL for ad-hoc testing runs when I open it.
Is there really no way to have an action tool use the "Q" input from a text input tool (a normal workflow input tool and not the interface one)? Or still no other methods in Alteryx or trickery that would allow me to hard set the different testing schemas through PreSQL statement updates in one place, on ad-hoc runs of the workflow?
The only other way I could think to do this is to write a script to change the underlying XML. But I'd rather not have to download it from Server, run a script to update the XML outside of Alteryx, and then open and run in Designer.
Throw the input tools into a macro - use an action tool to update the presql- hook up a control parameter to pass in the schema. This is pretty straight-forward and is the best option here if you have to use presql.
If you do not need PRESQL and can use IN-DB tools - you can use dynamic input-in-db to feed in workflow generated SQL- but you'd still need to use a batch macro for that. You do have greater visbilitiy on what is going into your DB though.