Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

No output generated for dynamic when empty sql response


Hi all,


In an analytic app, I have a dynamic input to run a given dynamic SQL statement, followed by a yxdb output. Whenever the sql statement returns no result, I noticed that the expected yxdb is not created (vs. a normal input where it is indeed created but empty).


This is a big issue as I have further workflows making use of the expected table. Any clue how to deal with this without maintaining and moving around pre-generated empty yxdb files ?


I am using Alteryx v2019.2




Can you create a request (to  generate the structure of the table) with one row of data for example, then remove this row and use a union tool with the result of the other query?


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


I would like to second @WilliamR's post if you haven't already tried it. This technique is something that I use all the time for different scenarios like cross tabs, etc.


What you are doing is taking a text input tool and creating a column header for each of the expected fields that are coming in. You don't have to create any records. You then put a select tool after that so that you can define the data types in those fields. You then union this to the main stream of data coming out of the dynamic input.


The idea here is that you are creating meta-data for all of your fields for the rest of your workflow/output. I think that someone needs to write up a blog about this technique