Skip to main content
Solved

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

  • April 16, 2019
  • 2 replies
  • 31 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • 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
  • Author
  • 70 replies
  • 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.

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

 

 

Thanks a million!