Skip to main content
Solved

How to set up workspace runner to simply change a few character in a sql statement?


Forum|alt.badge.img

Hi there,

I've never had to use the workspace runner before, and I'm kind of lost on how to set it up in the way I need it to function.

So currently I have a very simple workspace that is essentially just a SQLCreator and an Excel sheet writer outputting some measurement summaries. My SQL statement connects to a PostGIS database, which contains a list of per-country tables. All these tables are named the same (i.e. "France_full_2019", "Ireland_full_2019") except for the country name.

In this workbench I added a plain text parameter in the SQL lines instead of a specific country, so in this way, running the workbench, I can type "France" in the parameter window and get France's data. This all works perfectly fine and as intended, but of course limits me to 1 country at a time...

This is where my request comes in:

I want to know how to use the workspace runner to somehow input an entire list of countries and have it run the above mentioned workbench for each of list entries individually.

I've tried toying around with it but with little to no success...

 

Thanks in advance for any insight.

Best answer by ebygomm

I don't think you need a workspace runner for this scenario. If you read in your list of countries, use the values to create an sql statement for each one and then use an sqlexceutor to execute the statement you will get outputs for all countries. As long as you keep an attribute that defines the country you can then use this as a fanout on the excel writer.

View original
Did this help you find an answer to your question?

2 replies

ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • Best Answer
  • April 16, 2019

I don't think you need a workspace runner for this scenario. If you read in your list of countries, use the values to create an sql statement for each one and then use an sqlexceutor to execute the statement you will get outputs for all countries. As long as you keep an attribute that defines the country you can then use this as a fanout on the excel writer.


Forum|alt.badge.img
ebygomm wrote:

I don't think you need a workspace runner for this scenario. If you read in your list of countries, use the values to create an sql statement for each one and then use an sqlexceutor to execute the statement you will get outputs for all countries. As long as you keep an attribute that defines the country you can then use this as a fanout on the excel writer.

Works perfectly :). I Guess I overthinked it a bit and got stuck at an SQLCreator instead of just using the SQLExecutor.

 

 

Thanks a million!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings